Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 09:03 26 Jun 2022 Privacy Policy
Jump to

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 2 of 3    
Author Message
lew247

Guru

Joined: 23/12/2015
Location: United Kingdom
Posts: 1584
Posted: 09:01am 20 Jan 2022
Copy link to clipboard 
Print this post

Peter
Have a look here *Custom Compiled ESP-AT Firmware Binaries*

  Quote  These are the AT command firmwares for ESP8266 compiled from Espressif ESP-AT Source Code.
The firmwares have two different sizes:

   Cytron_ESP-01S_AT_Firmware - For ESP8266 with 1MB flash size (eg: ESP-01), doesn't support OTA update.
   Cytron_ESP-12F_WROOM-02_AT_Firmware - For ESP8266 with flash size 2MB or above (eg: ESP-12E, ESP-12F, WROOM-02).


It has links for a simple ESP flash tool with instructions and there is only 1 binary to flash

This is the espress gitgub page with more information including the roadmap
These are the AT commands








***The next version of ESP-AT firmware (v2.4.0.0) is planned to be released in March 2022. At present, only ESP32-C3 series firmware is planned to be released, and ESP32-C3 firmware would support Bluetooth LE 5.0.***

This should do what everyone wants? and be easy enough to use?
And once it's flashed it can be updated over the air {if neeeded}
Edited 2022-01-20 19:08 by lew247
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 6225
Posted: 09:26am 20 Jan 2022
Copy link to clipboard 
Print this post

  Quote  This should do what everyone wants? and be easy enough to use?

MQTT seems to be missing

  Quote  And once it's flashed it can be updated over the air {if neeeded}


  Quote  Cytron_ESP-01S_AT_Firmware - For ESP8266 with 1MB flash size (eg: ESP-01), doesn't support OTA update.

Edited 2022-01-20 19:27 by matherp
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 1409
Posted: 10:02am 20 Jan 2022
Copy link to clipboard 
Print this post

@lew247

The ESP family is like the raspberry pi (not pico, but pi0,1,2,3,4) as they are platforms that are widely under development (and change).

That is why it may be better to NOT allow things like updates over the air.
With the update over the air the ESP may become inoperable from MMBasic.

That is why it may be best to write the pre-made image from MMBasic (and not through some PC tooling) since you have better control over what software is running on the ESP. If you suggest PC tooling, even if you stipulate "use 1.7.4" people will put the latest firmware on to it, and Peter is constantly debugging why person X has a problem.

That was also the death of PicRomite. The constant change of the Raspberry Pi platform. Uderstand why Peter is hesitant to implement ESP.

I hope this clarifies,

Volhout
If nothing goes right ... turn left
 
lew247

Guru

Joined: 23/12/2015
Location: United Kingdom
Posts: 1584
Posted: 10:08am 20 Jan 2022
Copy link to clipboard 
Print this post

  matherp said  
  Quote  This should do what everyone wants? and be easy enough to use?

MQTT seems to be missing

  Quote  And once it's flashed it can be updated over the air {if neeeded}

IF NEEDED* it shouldn't be once it's working
  Quote  Cytron_ESP-01S_AT_Firmware - For ESP8266 with 1MB flash size (eg: ESP-01), doesn't support OTA update.

Again shouldn't be needed once working*



That was precompiled binaries and the information on their page
This is the MQTT AT Commands

   AT+MQTTUSERCFG: Set MQTT user configuration
   AT+MQTTCLIENTID: Set MQTT client ID
   AT+MQTTUSERNAME: Set MQTT username
   AT+MQTTPASSWORD: Set MQTT password
   AT+MQTTCONNCFG: Set configuration of MQTT connection
   AT+MQTTALPN: Set MQTT Application Layer Protocol Negotiation (ALPN)
   AT+MQTTCONN: Connect to MQTT Brokers
   AT+MQTTPUB: Publish MQTT Messages in string
   AT+MQTTPUBRAW: Publish MQTT messages in binary
   AT+MQTTSUB: Subscribe to MQTT topics
   AT+MQTTUNSUB: Unsubscribe from MQTT topics
   AT+MQTTCLEAN: Close MQTT connections
   MQTT AT Error Codes
   MQTT AT Notes


Full AT command set





This page has the official EspressIF binaries for the various ESP chips along with the flashing tool
Edited 2022-01-20 20:14 by lew247
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 6225
Posted: 10:13am 20 Jan 2022
Copy link to clipboard 
Print this post

  Quote  That was precompiled binaries and the information on their page
This is the MQTT AT Commands


They have to be compiled into the binary otherwise they aren't there. Without a major amount of work it seems impossible to know what is included in who's local build and Expressif (possibly deliberately) have clearly broken the ESP-01(S)

This is my last post on this issue I'm not pursuing it further and not including support in any port of my ports of MMbasic, too messy and too chaotic - sorry Lewis
 
lew247

Guru

Joined: 23/12/2015
Location: United Kingdom
Posts: 1584
Posted: 05:00pm 20 Jan 2022
Copy link to clipboard 
Print this post

  matherp said  
They have to be compiled into the binary otherwise they aren't there. Without a major amount of work it seems impossible to know what is included in who's local build and Expressif (possibly deliberately) have clearly broken the ESP-01(S)

This is my last post on this issue I'm not pursuing it further and not including support in any port of my ports of MMbasic, too messy and too chaotic - sorry Lewis


I totally understand, but for anyone interested I found this
Which tells you how to simply and easily make your own binary with only the actual modules you need using the NODEMCU page HERE

You simply select which branch you want to build your binary from, select and it builds it for you online.


The 512K branch is for the ESP8266-01 with memory of less than 1Mb (most of the early ones released)






This is the full list of modules you can select, you just pick the modules you want



It might be of use to anyone that has or wants to use any of the ESP modules from 8266, 8285, esp32 wifi mqtt (still no idea what that is) or other things

This way you're using your own binary that has only the actual modules you want/need in it

The only issue is it doesn't use the AT command set but is NODEMCU

it seems easy to use but I can't say, it does however look like sending commands to it from any MM device would be really simple

Programming Model

The NodeMCU programming model is similar to that of Node.js, only in Lua. It is asynchronous and event-driven. Many functions, therefore, have parameters for callback functions. To give you an idea what a NodeMCU program looks like study the short snippets below. For more extensive examples have a look at the /lua_examples folder in the repository on GitHub.

-- a simple HTTP server
srv = net.createServer(net.TCP)
srv:listen(80, function(conn)
   conn:on("receive", function(sck, payload)
       print(payload)
       sck:send("HTTP/1.0 200 OK\r\nContent-Type: text/html\r\n\r\n<h1> Hello, NodeMCU.</h1>")
   end)
   conn:on("sent", function(sck) sck:close() end)
end)

-- connect to WiFi access point
wifi.setmode(wifi.STATION)
wifi.sta.config("SSID", "password")

-- register event callbacks for WiFi events
wifi.sta.eventMonReg(wifi.STA_CONNECTING, function(previous_state)
   if(previous_state==wifi.STA_GOTIP) then
       print("Station lost connection with access point. Attempting to reconnect...")
   else
       print("STATION_CONNECTING")
   end
end)

-- manipulate hardware like with Arduino
pin = 1
gpio.mode(pin, gpio.OUTPUT)
gpio.write(pin, gpio.HIGH)
print(gpio.read(pin))
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 2092
Posted: 05:49pm 20 Jan 2022
Copy link to clipboard 
Print this post

Those are useful links, Lew--thanks for researching and posting.
 
flasherror
Senior Member

Joined: 07/01/2019
Location: United States
Posts: 155
Posted: 05:50pm 20 Jan 2022
Copy link to clipboard 
Print this post

  Quote  make your own binary with only the actual modules you need using the NODEMCU page HERE


I have built NodeMCU binaries a few times at various times using the online builder and never got it to work reliably despite trying different ESP8266 modules etc. Lots of crashes/reboots. Same hardware was rock solid using Arduino IDE so I gave up on NodeMCU. I think the NodeMCU firmware overhead was too much for a resource limited device like the 8266.

I was looking for a tiny ESP32 module with through hole header pins like the ESP01 but couldn't find one. Is there a ESP32 version of ESP01?
Edited 2022-01-21 03:53 by flasherror
 
bigfix
Senior Member

Joined: 20/02/2014
Location: Austria
Posts: 111
Posted: 06:34pm 24 Jan 2022
Copy link to clipboard 
Print this post

Posted this accidently in the SPI thread - better fit here

Another interesting SW option for ESP8266 is Tasmota
Tasmota GitHub

Tasmota getting started

It started as an alternative SW for some chinese Sonoff WIFI actuators
In the meantime it became a very powerful and flexible SW for ESP8266 and ESP32

I use it on a relay board to control my gardensprinklers via a WEB IF and some timers
Since I installed it 10 month ago, it did not have a single problem
I use a free Android App to interface to the API, but the WEB IF also works fine

Being lazy, I bought preflashed units from Athom - everything worked fine so far
(You need to specify Tasmota as SW when ordering)

Athom Ali Store

Besides WEB IF & API it fully supports MQTT and a serial command IF

It can act as a MQTT to serial bridge, I am not sure about serial to MQTT function
But about everything is possible by issuing commands to the serial console

So it could be interesting as a WEB & MQTT frontend to a mite
Edited 2022-01-25 04:39 by bigfix
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 1409
Posted: 09:34pm 24 Jan 2022
Copy link to clipboard 
Print this post

8266 seems not in their shop anymore.
I guess it is phasing out everywhere.

Volhout
If nothing goes right ... turn left
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 2443
Posted: 09:44pm 24 Jan 2022
Copy link to clipboard 
Print this post

Could just be the general silicon shortage. There still seems to ba a lot on ebay.
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs
 
MikeO
Senior Member

Joined: 11/09/2011
Location: Australia
Posts: 259
Posted: 08:28am 26 Jan 2022
Copy link to clipboard 
Print this post

Been experimenting with my Raspberry Pi - Picomite combination. Raspberry Pi (could be a Pi Zero W)running Node-Red works extremely well parsing HTTP "Get" to APIs in this case OpenWeatherMap. This makes all types of Network/Internet comms possible (HTTP, MQTT, UDP ) etc. In this case I did a HTTP request to OWM as a 7 Day Forecast request and I have just selected a few nodes to send to the Pico. Here is screenshot of the "Flow" (Node-Red speak) and the received data on the Pico.





Edited 2022-01-26 18:33 by MikeO
Codenquilts
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 2443
Posted: 08:53am 26 Jan 2022
Copy link to clipboard 
Print this post

That's so pretty - but completely beyond my comprehension. :)

I may have to go and lie down in a darkened room now...
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs
 
georgestheking
Newbie

Joined: 21/12/2021
Location: Belgium
Posts: 16
Posted: 09:59am 26 Jan 2022
Copy link to clipboard 
Print this post

Hi,

I think the best is select a specific hardware and select and publish a firmware.
For example ESP01S with firmware X.X. ( link for download )

To be sure that everybody use the same peripherical with the same firmware.
Then you can add a library into picomite.

That is only my advice,

Georges
 
bigfix
Senior Member

Joined: 20/02/2014
Location: Austria
Posts: 111
Posted: 10:06am 26 Jan 2022
Copy link to clipboard 
Print this post

  Quote  I think the best is select a specific hardware and select and publish a firmware.
For example ESP01S with firmware X.X. ( link for download )

To be sure that everybody use the same peripherical with the same firmware.
Then you can add a library into picomite.


Fully agree - download should be "frozen" and longterm available on a MMite site
 
MikeO
Senior Member

Joined: 11/09/2011
Location: Australia
Posts: 259
Posted: 11:20am 26 Jan 2022
Copy link to clipboard 
Print this post

That's fine, not advocating, just suggesting as others had done, until someone writes such universal code for suitable hardware, there are other ways that may suit as a solution for some situations.

Cheers, Mike
Codenquilts
 
lew247

Guru

Joined: 23/12/2015
Location: United Kingdom
Posts: 1584
Posted: 11:23am 26 Jan 2022
Copy link to clipboard 
Print this post

ESP8266 flashed with the AT command set
From what I can see it has the full AT command set installed

IF I can find an ESP8266 and a programmer I'll try flashing it with the firmware which can be downloaded here and see what commands actually are installed
This firmware is for the 1MB and doesn't support OTA
This image is for the larger ESP8266-12

I think I might have got rid of the programmer though so if anyone else has an ESP8266 and actually wants to try it?





For those with the 512K esp8266 here's a link to the last version of Espressif's 1.74 binary for that one
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 2524
Posted: 11:44am 26 Jan 2022
Copy link to clipboard 
Print this post

@lew247, sorry to hijack the thread, but did you see my email reply yesterday?

Best wishes,

Tom
CMM2 Welcome Tape, Creaky old text adventures
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 2443
Posted: 12:50pm 26 Jan 2022
Copy link to clipboard 
Print this post

It's the same support problem, isn't it? They put up version 2.2.0 binaries, but where's the command list? It would have been easy to include that on Github - after all, someone put the binaries there. Why should the user have to try every possible combination of every command to see if it works? What about new commands that weren't in previous versions? How do we know they are there? Do these people not care about their users? We know the Cytron AT commands aren't exactly Hayes compatible in some ways, but in *what* ways?

This *may* help:
https://drive.google.com/file/d/1zrOoTNiCZ-GEth75b6xNpIUiE0UkjG61/view
Edited 2022-01-26 23:00 by Mixtel90
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 6225
Posted: 01:06pm 26 Jan 2022
Copy link to clipboard 
Print this post

  Quote  It's the same support problem, isn't it? They put up version 2.2.0 binaries, but where's the command list?

Fully agree. One of the key requirements is MQTT is it included? Nowhere is there any useful information.

Makes me appreciate even more Geoff's wonderful manuals  
 
     Page 2 of 3    
Print this page
© JAQ Software 2022