Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
|
Forum Index : Microcontroller and PC projects : ESP8266 AT support in MMBasic
Page 1 of 3 | |||||
Author | Message | ||||
lew247 Guru Joined: 23/12/2015 Location: United KingdomPosts: 1676 |
Following on from Can people please post suggestions here? I will start: WGET (but I've no idea what AT command you would use for this) |
||||
georgestheking Newbie Joined: 21/12/2021 Location: BelgiumPosts: 20 |
Hi, My propossal to open the debate. Only 4 WIFI MQTT command : connect(server_IP,id,Timeout .. ) publish(token,value) subscribe(token) disconnect() Best regards Georges Belgium |
||||
JohnS Guru Joined: 18/11/2011 Location: United KingdomPosts: 3662 |
Is far too high level. Details of every part of how to get to that are required, I suspect. John |
||||
georgestheking Newbie Joined: 21/12/2021 Location: BelgiumPosts: 20 |
|
||||
MikeO Senior Member Joined: 11/09/2011 Location: AustraliaPosts: 275 |
For those wanting to use wifi to send data by MQTT, UDP or HTTP to web APIs , the simplest approach may be just to use ESPEasy. I have used such a combination mx170 etc with esp8266 to transmit UDP and HTTP message's with almost 100% relability for several years. Edited 2022-01-19 18:23 by MikeO Codenquilts |
||||
Mixtel90 Guru Joined: 05/10/2019 Location: United KingdomPosts: 5736 |
Wouldn't it make more sense to produce a FAQ on wireless communications for MMBasic along with a set of *documented* library routines? I'm not even sure that integrating this into MMBasic is even possible as there are a few variations. You will always end up in a situation where the built-in commands don't *quite* do what's required. There are probably no situations where several comms standards are wanted. We need those who are knowledgeable to pool their resources on this. Create a working document, detailing what works and what doesn't - TESTED VERSIONS ONLY. It's no use detailing stuff that's so cutting edge that no-one has used it successfully on a 'mite yet. It doesn't matter if it works on XYZ hardware, make it work on a 'mite *then* document it. Once that's done you can start to think about multi-platform libraries. It's no use writing only for the CMM2 or only for the PicoMite or only for the Armmite xx unless there are *very specific* reasons. Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 8592 |
I've done a bit of research and IMHO the whole ESP space is now a complete nightmare. As far as I can see the latest AT firmware which supports MQTT won't run on a ESP-01(S) as it both needs 2MB of flash and uses different pins for the UART connection. Even if it could run then I can't find any way to actually flash it. There seems to be 12 different binaries that need downloading to different addresses. Every community now runs their own versions of ESP firmware: NodeMCU, Arduino, Espruino, LUA, MicroPython etc and there are so many variants of the ESP32 chips and boards that providing any sensible support in MMBasic is a complete non-starter. I'm running the, now no longer recommended by Expressif, V1.7.4 which provides reliable AT commands to allow TCP and UDP connections as per my previous example MMBasic programs(but not MQTT support). There is little advantage in including support for this as it is no longer current and is so simple to use from Basic anyway. If Expressif ever provide an official version of AT IDF firmware for the 1MB ESP-01 then perhaps something could be done but until then any MMBasic ESP support is off the table. Edited 2022-01-19 20:21 by matherp |
||||
flasherror Senior Member Joined: 07/01/2019 Location: United StatesPosts: 159 |
Although I haven't flashed ESP8266 in a long time, I agree that programming ESP devices with separate files/memory areas is a pain, and I'm not sure why the change was made from the real easy "flash this file and it works", although I'm sure there is a reason. Never understood why there isn't a config file included with firmware and the flash utility does the work. I'm not sure about the requirement for 2MB ESP01 modules being a problem, apart from user might have to buy a new module in order to use MQTT firmware. I remember the early ESP01 modules had only 512K flash and was a problem once the AT command firmware got large enough, so looks like history repeats itself. Also, this might be a mistake but https://docs.espressif.com/projects/esp-at/en/release-v2.2.0.0_esp8266/Compile_and_Develop/How_to_understand_the_differences_of_each_type_of_module.html lists the 8266 1MB as supporting MQTT (CTRL-F "ESP8266_1MB_AT_Bin" and see AT MQTT Command support). Not sure which 8266 version they are referring to. Also about the different pins issue see https://github.com/jandrassy/WiFiEspAT "The AT 2 binary for esp8266 build by Espressif requires at least 2 MB flash and uses pins 15 as TX and 13 as RX. To have the AT firmware communicating on usual pins 1 as TX and 3 as RX, you can use at flashing of the firmware AT2_esp8266_factory_param_tx1rx3.bin from extras folder of this library instead of factory_param.bin bundled with the AT firmware." Edited 2022-01-20 03:22 by flasherror |
||||
Mixtel90 Guru Joined: 05/10/2019 Location: United KingdomPosts: 5736 |
2MB for a box that only converts RXD/TXD to RF? When I were a lad we got the whole word processor and the document and the spelling checker in 48k or less.... Remember - AT commands were developed by Hayes to make it *easy* to control a modem. What went wrong? Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
flasherror Senior Member Joined: 07/01/2019 Location: United StatesPosts: 159 |
You sound like one of Monty Python's Four Yorkshiremen ESP AT firmware is more than an AT command parser, also has the WiFi firmware bits which are beyond my understanding. Peter, also check out https://github.com/jandrassy/UnoWiFiDevEdSerial1/wiki/files/ESP8266-1MB-tx1rx3-AT_V2.2.zip which is a 1MB v2.2 firmware. Unknown whether it support MQTT (Found it at https://github.com/jondurrant/RPIPicoRTOSMQTT so I'm guessing it does) Edited 2022-01-20 03:54 by flasherror |
||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 8592 |
These are both A.N.Other doing their own builds. Not the basis for including in the firmware. Plus there is still the issue of 12 separate binaries and zero "simple" instructions as to how to flash. This sort of basis is incompatible with MMBasic being accessible to the average user =- sorry |
||||
bigfix Senior Member Joined: 20/02/2014 Location: AustriaPosts: 124 |
I did not flash ESP8266 for quite some time So my currrent knowledge is rather limited Is there a chance to create a working unit from all the right code pieces ? Then after verification read the whole flash as a single image and save it ? Goal is to get a "frozen" stable single image to work with This could be distributed together with a proven flash toolset to make it easy even for new users The ultimate goal could be to flash a blank ESP directly from a MMbasic system with a trusted ESP flash image derived from the MMbasic distribution |
||||
JohnS Guru Joined: 18/11/2011 Location: United KingdomPosts: 3662 |
Should work. John |
||||
Volhout Guru Joined: 05/03/2018 Location: NetherlandsPosts: 3557 |
There was a basic progam to flash a pic16f1455 from the mx170, so it becomes a microbridge. Something similar to flash the esp8266. And the binary could be something that simply works, maybe Peters 1.7.4. PicomiteVGA PETSCII ROBOTS |
||||
phil99 Guru Joined: 11/02/2018 Location: AustraliaPosts: 1794 |
Another example is MMflash which can be found on TassyJim's site that uses an MM2 or MM+ to flash any PIC32 using Pic32prog.exe and Peters Pic32prog CSub. |
||||
Mixtel90 Guru Joined: 05/10/2019 Location: United KingdomPosts: 5736 |
Of course, that's providing the ESP8266 supports having all its flash written at once. There may be a sound reason why it's segmented - like you can't address it as one block. I dunno... Only guessing. Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
flasherror Senior Member Joined: 07/01/2019 Location: United StatesPosts: 159 |
One thing to consider is that there may be config data in flash (RF calibration, MAC address etc) which may be unique to each module. Other things to think about for programming the 8266 using Picomite or other MMBASIC device: v2.2 1MB esp-at.bin is nearly 800KB alone in size. This means firmware will have to be on SD card and read in chunks and sent to 8266. Is a Basic program fast enough? What is the fastest reliable baudrate for Picomite to upload to 8266? In case CRC has to be done on firmware file to compare with programmed checksum how long will it take for Pico to compute this? I think maybe figuring out a step-by-step document on programming 8266 using PC might be easier than attempting to program using Picomite. Edited 2022-01-20 10:25 by flasherror |
||||
lizby Guru Joined: 17/05/2016 Location: United StatesPosts: 3017 |
And perhaps posted to fruitoftheshed so it doesn't just scroll off into oblivion, like this thread or this one. PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed |
||||
phil99 Guru Joined: 11/02/2018 Location: AustraliaPosts: 1794 |
Re programming speed, here is a comparable example. C:\Temp\Micromite_Firmware50502>pic32prog.exe -d ascii:com6 Micromite_Plus_V5.05.02.hex Programmer for Microchip PIC32 microcontrollers, Version 2.0.220 Copyright: (C) 2011-2015 Serge Vakulenko (ascii ICSP coded by Robert Rozee) Adapter: ...... OK1 OK2 - ascii ICSP v1E Processor: MX470F512H Flash memory: 512 kbytes Boot memory: 12 kbytes Data: 519988 bytes Erase: (90mS) done Loading PE: 1 2 3 4 (LDR) 5 6 7a (PE) 7b 8 v0201 Program flash: #################################################### done Program boot: ######### done Verify flash: #################################################### done Verify boot: ######### done Program rate: 3849 bytes per second total TDI/TMS pairs sent = 4703307 pairs total TDO bits received = 191736 bits total ascii codes sent = 1398843 total ascii codes recv = 65934 maximum continuous write = 452 chars O/S serial writes = 130814 O/S serial reads (data) = 6000 O/S serial reads (sync) = 2539 XferFastData count = 112518 10mS delays (E/X/R) = 9/0/0 elapsed programming time = 2m 17s At 2m 17s for a 1439kB HEX file an MX170 with MMBasic or Arduino Nano have no problems programming a PIC32 via serial from a PC. Edited 2022-01-20 12:33 by phil99 |
||||
JohnS Guru Joined: 18/11/2011 Location: United KingdomPosts: 3662 |
Perhaps it's simply to program faster so as to avoid people waiting. E.g. 2 mins is ages lol John |
||||
Page 1 of 3 |
Print this page |