CMM2: V5.07.00b11: json support with full ESP-01 example code


Author Message
mclout999
Guru

Joined: 05/07/2020
Location: United States
Posts: 383
Posted: 01:23pm 09 Aug 2021      

  matherp said  
  Quote   What else do I need to do to get it localized and reporting right?


Set MYID$ to the code for where you want. Codes are downloaded from the weather site in a json file


Thank you that was the info I needed.  It works fine now.  I had no idea.  I was misinterpreting the info from the first post here.  
  Quote  You need to substitute your own wifi login details and your own openweathermap api username and key


I was putting my user name in there.  Thanks.

On to my next bit of needed info on your second listing.  It runs and then says connected.  Then what do I need to do to access it.  I am trying to find what IP it has taken but my router is not showing me anything but several ESP listings with no IPs.  Do we need anything else?  I tried to add a line after connected that would list the IP but no go

matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 6619
Posted: 02:08pm 09 Aug 2021      

  Quote  I am trying to find what IP it has taken


open "com2:115200,4096" as #1
IF NOT Command(0, "AT",obuff(), 500) THEN END
IF NOT Command(0, "AT+RST",obuff(), 10000,"WIFI GOT IP") THEN 'reset and check for valid connection
  PRINT "Set up WIFI on SSID: ",SSID$
  IF NOT Command(0, "AT+CWMODE_DEF=1",obuff(), 5000) THEN END 'set device mode (1=client, 2=AP, 3=b
  IF NOT Command(0, "AT+CWLAP",obuff(), 30000) THEN END 'scan for WiFi hotspots
  longstring print inbuf() 'output the list of valid networks
  IF NOT Command(0, "AT+CWJAP_DEF="+SSID$+","+SSIDPassword$,obuff(), 20000,"WIFI GOT IP") THEN END
  IF NOT Command(0, "AT+CIFSR",obuff(), 5000) THEN END 'check IP address
ENDIF
print #1,"AT+CIFSR"+chr$(13)+chr$(10);
pause 500
print input$(100,1)


IF NOT Command(0, "AT+CIPMUX=1",obuff(), 5000) THEN END
IF NOT Command(0, "AT+CIPSERVER=1,80",obuff(), 5000) THEN END
Print "Connected"

toml_12953
Senior Member

Joined: 13/02/2015
Location: United States
Posts: 273
Posted: 03:02pm 09 Aug 2021      

  matherp said  I'm not getting a response to CIPSTART today from api.openweathermap.org so can't help. Perhaps they have an issue or have changed something - anyone got anything working with openweathermap?


Today I'm having a CIPSEND issue. Has anyone figured out what's happening?
Edited 2021-08-10 01:10 by toml_12953

mclout999
Guru

Joined: 05/07/2020
Location: United States
Posts: 383
Posted: 07:50pm 09 Aug 2021      

  toml_12953 said  
  matherp said  I'm not getting a response to CIPSTART today from api.openweathermap.org so can't help. Perhaps they have an issue or have changed something - anyone got anything working with openweathermap?


Today I'm having a CIPSEND issue. Has anyone figured out what's happening?


matherp posted how he fixed it and it workded for me as well.

  Quote  UPDATE - did a AT+RESTORE on the ESP and now working with the posted code
Edited 2021-08-09 01:29 by matherp


 I edited an earlier posted program that printed out the version to just send that command to the ESP01.

mclout999
Guru

Joined: 05/07/2020
Location: United States
Posts: 383
Posted: 07:57pm 09 Aug 2021      

matherp, Thank you for the update.  It works flawlessly.

toml_12953
Senior Member

Joined: 13/02/2015
Location: United States
Posts: 273
Posted: 06:37am 23 Sep 2022      

  matherp said  V5.07.00b11 now available for download

This release also supports a json parsing function.


Examples taken from api.openweathermap.org



I used to be able to run this weather station program but now I bomb out at

AT+CIPSEND

every time. This means I can log onto my network and connect to the openweathermap website but then it gets hung up somehow. Has something changed since this was first written?

matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 6619
Posted: 10:51am 23 Sep 2022      

Just tested and works fine for me. Check version of the ESP

toml_12953
Senior Member

Joined: 13/02/2015
Location: United States
Posts: 273
Posted: 02:20pm 23 Sep 2022      

  matherp said  Just tested and works fine for me. Check version of the ESP


Thanks for checking! It's V 1.7.4
Edited 2022-09-24 02:35 by toml_12953