![]() |
Forum Index : Microcontroller and PC projects : 4 $ WiFi Serial Transceiver Module
![]() ![]() ![]() ![]() |
|||||
Author | Message | ||||
viscomjim Guru ![]() Joined: 08/01/2014 Location: United StatesPosts: 925 |
there are several posts on the web that indicate that the AT+GMR will return what you see, mine does also, but it is the current version 922. You can tell this by the fact that you are working at 9600 baud and you can change the baud rate. Before it was only 115000. You can crank it up to 230400 with the uMite. Have fun!!!! |
||||
paceman Guru ![]() Joined: 07/10/2011 Location: AustraliaPosts: 1329 |
@viscomjim A quick note - OBC's updated little Terminal Program has a typo - an extra " that shouldn't be there in the line: if a$ <> """ then print #1,a$;
Greg |
||||
viscomjim Guru ![]() Joined: 08/01/2014 Location: United StatesPosts: 925 |
You are correct sir!!!! MMedit (colors) caught it before I sent it to the uMite. |
||||
jman![]() Guru ![]() Joined: 12/06/2011 Location: New ZealandPosts: 711 |
Hi Viscomjim Could you please outline the process to upgrade the modules. Mine finally arrived. I can connect to them with Teraterm but XTCOM cannot find the module (com port and speed are set correctly) Regards Jman |
||||
Bryan1![]() Guru ![]() Joined: 22/02/2006 Location: AustraliaPosts: 1483 |
G'day Guy's, Well reading this thread has given me interest again so I went and looked on fleabay and got one for $4.59. It is on the slow boat from China so hopefully before the month is out it will be here. Then time to play.... |
||||
viscomjim Guru ![]() Joined: 08/01/2014 Location: United StatesPosts: 925 |
HERE is the wiring diagram I used for updating. . The only difference from the regular wiring that you have in the instructable is that you have to bring gpio 0 low while programming. After programming, unhook gpio 0 and then I just power cycled the unit. I wired the unit directly to the usb to ttl serial board as described on that page - just don't do any of the steps listed on that page other than the wiring. Then this... Firmware uploading tool File:XTCOM UTIL.zip How to use Download the bin file Set the module to update mode (by tying gpio0 low), connect the module : choose "tools" - "configure device" Upload bin file: API Test - Flash image download, upload the bin file at 0x0000 This picture is the wiring for "normal" use. Courtesy of OBC's instructable. ![]() Going to get some sleep now. Good luck!!! |
||||
paceman Guru ![]() Joined: 07/10/2011 Location: AustraliaPosts: 1329 |
@viscomjim, Well, well, I have weather working! I changed the GET statement to the Sydney one you suggested (got rid of the extra 'space' in Australia, and the SERVER address at the top of the program the way you suggested for over here by pinging api.wunderground.com - it came back different to yours i.e. 23.9.235.83 The Australian server for it maps to: e204.g.akameiedge.net[23.9.235.83] The first try I forgot to change the baud rate of the module again to match your weather program (115200) so had to reload OBC's new Simple Terminal program again and send the new baud rate command. Reloaded the weather program, ran it and in it came, several pages of it - took about 1 or 2 seconds to start. I'll see if I can catch a file of the output to post. Greg |
||||
paceman Guru ![]() Joined: 07/10/2011 Location: AustraliaPosts: 1329 |
As usual, Jim Hiley's MMEdit to the rescue again - here's the output as from the RUN command. Greg RUN
AT+CIPSEND >HTTP/1.1 200 OK Server: Apache/2.2.15 (CentOS) X-CreationTime: 0.077 Last-Modified: Thu, 16 Oct 2014 05:36:09 GMT Content-Type: application/json; charset=UTF-8 Expires: Thu, 16 Oct 2014 05:36:09 GMT Cache-Control: max-age=0, no-cache Pragma: no-cache Date: Thu, 16 Oct 2014 05:36:09 GMT Content-Length: 10442 Connection: keep-alive Set-Cookie: DT=1413437769:23460:365-l2; path=/; expires=Fri, 01-Jan-2020 00:00:00 GMT; domain=.wunderground.com { "response": { "version":"0.1", "termsofService":"http://www.wunderground.com/weather/api/d/ terms.html", "features": { "geolookup": 1 , "conditions": 1 } , "error": { "type": "unknownfeature" } } ,"location": { "type":"INTLCITY", "country":"AU", "country_iso3166":"AU", "country_name":"Australia", "state":"NW", "city":"Sydney", "tz_short":"AEDT", "tz_long":"Australia/Sydney", "lat":"-33.95000076", "lon":"151.17999268", "zip":"00000", "magic":"1", "wmo":"94767", "l":"/q/zmw:00000.1.94767", "requesturl":"global/stations/94767.html", "wuiurl":"http://www.wunderground.com/global/stations/94767. html", "nearby_weather_stations": { "airport": { "station": [ { "city":"Sydney Airport", "state":"", "country":"Australia", "icao":"YSSY", "lat":"-33.94649887", "lon":"151.17309570" } ,{ "city":"Sydney", "state":"", "country":"AU", "icao":"YSSY", "lat":"-33.94649887", "lon":"151.17309570" } ,{ "city":"Richmond (NSW)", "state":"", "country":"AU", "icao":"YSRI", "lat":"-33.60055542", "lon":"150.78083801" } ] } , "pws": { "station": [ { "neighborhood":"Victoria Street", "city":"Alexandria", "state":"NSW", "country":"AU", "id":"INSWALEX2", "lat":-33.912079, "lon":151.200607, "distance_km":4, "distance_mi":2 }, { "neighborhood":"Matraville", "city":"Sydney", "state":"NSW", "country":"AUSTRALIA", "id":"INSWMATR2", "lat":-33.957550, "lon":151.230850, "distance_km":4, "distance_mi":2 }, { "neighborhood":"Bardwell Park", "city":"Sydney", "state":"New South Wales", "country":"AUSTRALIA", "id":"INEWSOUT37", "lat":-33.938381, "lon":151.124359, "distance_km":5, "distance_mi":3 }, { "neighborhood":"Zetland", "city":"Zetland", "state":"NEW SOUTH WALES", "country":"AUSTRALIA", "id":"INEWSOUT431", "lat":-33.907227, "lon":151.212250, "distance_km":5, "distance_mi":3 }, { "neighborhood":"Kogarah Bay NSW Australia", "city":"Kogarah Bay", "state":"NEW SOUTH WALES", "country":"AUSTRALIA", "id":"INEWSOUT179", "lat":-33.981575, "lon":151.126099, "distance_km":6, "distance_mi":3 }, { "neighborhood":"Lewisham, NSW", "city":"Lewisham", "state":"NEW SOUTH WALES", "country":"AUSTRALIA", "id":"INEWSOUT255", "lat":-33.891712, "lon":151.146957, "distance_km":7, "distance_mi":4 }, { "neighborhood":"Blakehurst", "city":"Sydney", "state":"NSW", "country":"AUSTRALIA", "id":"INSWSYDN18", "lat":-33.988716, "lon":151.109955, "distance_km":7, "distance_mi":4 }, { "neighborhood":"Pyrmont NSW", "city":"Pyrmont", "state":"NEW SOUTH WALES", "country":"AUSTRALIA", "id":"INEWSOUT155", "lat":-33.871807, "lon":151.194977, "distance_km":8, "distance_mi":5 }, { "neighborhood":"East Sydney", "city":"Darlinghurst", "state":"NEW SOUTH WALES", "country":"AUSTRALIA", "id":"INEWSOUT349", "lat":-33.876339, "lon":151.216187, "distance_km":8, "distance_mi":5 }, { "neighborhood":"Woolloomooloo", "city":"Woolloomooloo", "state":"NSW", "country":"AUSTRALIA", "id":"INSWWOOL3", "lat":-33.874527, "lon":151.220734, "distance_km":9, "distance_mi":5 }, { "neighborhood":"Frederick Street", "city":"Wareemba", "state":"NSW", "country":"AU", "id":"INSWWARE2", "lat":-33.879208, "lon":151.124603, "distance_km":9, "distance_mi":5 }, { "neighborhood":"Old\u0027s Park", "city":"Penshurst", "state":"NSW", "country":"AUSTRALIA", "id":"INSWPENS2", "lat":-33.959465, "lon":151.074921, "distance_km":9, "distance_mi":5 }, { "neighborhood":"Oyster Bay", "city":"Oyster Bay", "state":"NEW SOUTH WALES", "country":"AUSTRALIA", "id":"INEWSOUT243", "lat":-33.998154, "lon":151.084473, "distance_km":10, "distance_mi":6 }, { "neighborhood":"Sutherland Shire - Caringbah South", "city":"Sydney", "state":"New South Wales", "country":"Australia", "id":"INSWCARI2", "lat":-34.048203, "lon":151.120697, "distance_km":12, "distance_mi":7 }, { "neighborhood":"Kareela", "city":"Kareela", "state":"NSW", "country":"AUSTRALIA", "id":"INSWKIRR2", "lat":-34.020538, "lon":151.075287, "distance_km":12, "distance_mi":7 }, { "neighborhood":"Sutherland Shire - Lilli Pilli", "city":"Caringbah South", "state":"NEW SOUTH WALES", "country":"Australia", "id":"INEWSOUT125", "lat":-34.059315, "lon":151.117416, "distance_km":13, "distance_mi":8 }, { "neighborhood":"Hunters Hill", "city":"Hunters Hill", "state":"NEW SOUTH WALES", "country":"AUSTRALIA", "id":"INEWSOUT246", "lat":-33.831470, "lon":151.134842, "distance_km":13, "distance_mi":8 }, { "neighborhood":"Lower North Shore", "city":"Linley Point (Lane Cove)", "state":"NEW SOUTH WALES", "country":"AUSTRALIA", "id":"INEWSOUT83", "lat":-33.826977, "lon":151.151077, "distance_km":13, "distance_mi":8 }, { "neighborhood":"Gymea Bay South of Sydney near Royal National Park", "city":"Sydney", "state":"NSW", "country":"Australia", "id":"ISYDNEY2", "lat":-34.047691, "lon":151.079971, "distance_km":14, "distance_mi":8 }, { "neighborhood":"Mansion Bay, Hacking River", "city":"Grays Point", "state":"NEW SOUTH WALES", "country":"AUSTRALIA", "id":"INEWSOUT183", "lat":-34.060741, "lon":151.089035, "distance_km":14, "distance_mi":8 }, { "neighborhood":"Grays Point, New South Wales", "city":"Grays Point", "state":"NEW SOUTH WALES", "country":"AUSTRALIA", "id":"INEWSOUT250", "lat":-34.058575, "lon":151.076462, "distance_km":15, "distance_mi":9 }, { "neighborhood":"Mosman", "city":"Mosman", "state":"NEW SOUTH WALES", "country":"AUSTRALIA", "id":"INEWSOUT404", "lat":-33.817410, "lon":151.246384, "distance_km":15, "distance_mi":9 }, { "neighborhood":"", "city":"Chatswood", "state":"New South Wales", "country":"Australia", "id":"INSWCHAT1", "lat":-33.805172, "lon":151.175674, "distance_km":16, "distance_mi":9 }, { "neighborhood":"Loftus Heights", "city":"Loftus", "state":"NSW", "country":"AUSTRALIA", "id":"INSWLOFT2", "lat":-34.049999, "lon":151.044800, "distance_km":16, "distance_mi":10 }, { "neighborhood":"South of Vic Rd", "city":"RYDE", "state":"NEW SOUTH WALES", "country":"AUSTRALIA", "id":"INEWSOUT220", "lat":-33.816193, "lon":151.094818, "distance_km":16, "distance_mi":10 }, { "neighborhood":"Chester Hill", "city":"Chester Hill", "state":"NEW SOUTH WALES", "country":"AUSTRALIA", "id":"INEWSOUT279", "lat":-33.892483, "lon":151.002258, "distance_km":17, "distance_mi":10 }, { "neighborhood":"Chatswood", "city":"Sydney", "state":"NSW", "country":"AUSTRALIA", "id":"INSWSYDN21", "lat":-33.788261, "lon":151.194473, "distance_km":18, "distance_mi":10 }, { "neighborhood":"North Ryde", "city":"North Ryde", "state":"NEW SOUTH WALES", "country":"AUSTRALIA", "id":"INEWSOUT324", "lat":-33.793289, "lon":151.122620, "distance_km":18, "distance_mi":10 }, { "neighborhood":"North Ryde Sydney", "city":"Macquarie Park", "state":"NSW", "country":"AUSTRALIA", "id":"INSWMACQ2", "lat":-33.785343, "lon":151.132812, "distance_km":18, "distance_mi":11 }, { "neighborhood":"Marsfield", "city":"Marsfield", "state":"NEW SOUTH WALES", "country":"AUSTRALIA", "id":"INEWSOUT247", "lat":-33.787659, "lon":151.109192, "distance_km":19, "distance_mi":11 }, { "neighborhood":"Sutherland Shire", "city":"Engadine", "state":"NSW", "country":"Australia", "id":"KNSENGAD1", "lat":-34.051315, "lon":151.009308, "distance_km":19, "distance_mi":11 }, { "neighborhood":"Lindfield, NSW", "city":"Lindfield", "state":"NEW SOUTH WALES", "country":"AUSTRALIA", "id":"INEWSOUT329", "lat":-33.773113, "lon":151.178528, "distance_km":19, "distance_mi":11 } ] } } } ,"current_observation": { "image": { "url":"http://icons.wxug.com/graphics/wu2/logo_130x80.png", "title":"Weather Underground", "link":"http://www.wunderground.com" }, "display_location": { "full":"Sydney, New South Wales", "city":"Sydney", "state":"NW", "state_name":"New South Wales", "country":"AU", "country_iso3166":"AU", "zip":"00000", "magic":"1", "wmo":"94767", "latitude":"-33.95000076", "longitude":"151.17999268", "elevation":"3.00000000" }, "observation_location": { "full":"Sydney, ", "city":"Sydney", "state":"", "country":"AU", "country_iso3166":"AU", "latitude":"-33.94649887", "longitude":"151.17309570", "elevation":"20 ft" }, "estimated": { }, "station_id":"YSSY", "observation_time":"Last Updated on October 16, 4:00 PM AEDT", "observation_time_rfc822":"Thu, 16 Oct 2014 16:00:00 +1100", "observation_epoch":"1413435600", "local_time_rfc822":"Thu, 16 Oct 2014 16:36:09 +1100", "local_epoch":"1413437769", "local_tz_short":"AEDT", "local_tz_long":"Australia/Sydney", "local_tz_offset":"+1100", "weather":"Clear", "temperature_string":"70 F (21 C)", "temp_f":70, "temp_c":21, "relative_humidity":"33%", "wind_string":"From the NE at 18 MPH", "wind_dir":"NE", "wind_degrees":50, "wind_mph":18, "wind_gust_mph":0, "wind_kph":30, "wind_gust_kph":0, "pressure_mb":"1015", "pressure_in":"29.98", "pressure_trend":"0", "dewpoint_string":"39 F (4 C)", "dewpoint_f":39, "dewpoint_c":4, "heat_index_string":"NA", "heat_index_f":"NA", "heat_index_c":"NA", "windchill_string":"NA", "windchill_f":"NA", "windchill_c":"NA", "feelslike_string":"70 F (21 C)", "feelslike_f":"70", "feelslike_c":"21", "visibility_mi":"N/A", "visibility_km":"N/A", "solarradiation":"--", "UV":"-1","precip_1hr_string":"-9999.00 in (-9999.00 mm)", "precip_1hr_in":"-9999.00", "precip_1hr_metric":"--", "precip_today_string":"0.00 in (0.0 mm)", "precip_today_in":"0.00", "precip_today_metric":"0.0", "icon":"clear", "icon_url":"http://icons.wxug.com/i/c/k/clear.gif", "forecast_url":"http://www.wunderground.com/global/stations/ 94767.html", "history_url":"http://www.wunderground.com/history/airport/Y SSY/2014/10/16/DailyHistory.html", "ob_url":"http://www.wunderground.com/cgi-bin/findweather/ge tForecast?query=-33.94649887,151.17309570", "nowcast":"" } } AT+CIPCLOSE OK Unlink > |
||||
paceman Guru ![]() Joined: 07/10/2011 Location: AustraliaPosts: 1329 |
Here's a tidied-up current version of viscomjim's weather program for Australia with some comments added by me. Greg 'ESP8266 WiFi Module & MicroMite Web Weather Access Program.
'Author: viscomjim 16/10/14 - MicroMite Basic V4.5 (Geoff Graham) '----------------------------------------------------------- -- SERVER$="23.9.235.83" 'Aust. IP for api.wunderground.com PORTX$="80" OPEN "Com1:115200, 4096" AS #1 'ESP module must be set to same rate FLUSHBUF 'i.e. use "AT+CIOBAUD=115200" PRINT #1,"AT+CWMODE=3" 'i.e. access point & client PAUSE 100: FLUSHBUF PRINT #1,"AT+CIPMUX=0" 'single connection PAUSE 100: FLUSHBUF PRINT #1,"AT+CIPMODE=1" 'data transmision mode = data mode PAUSE 100: FLUSHBUF PRINT #1,"AT+CIPSTART="+CHR$(34)+"TCP"+CHR$(34)+","+CHR$(34) +SERVER$+CHR$(34)+","+PORTX$ ' ...="TCP","23.9.235.83",80 PAUSE 500: FLUSHBUF PRINT #1,"AT+CIPSEND" 'send data, i.e. GET command as below PAUSE 400 PRINT #1,"GET /api/2b4e1c4572808d14/geolookup/conditions/forcast/q/Austral ia/Melbourn e.json HTTP/1.1"+CHR$(13)+CHR$(10)+"Host:api.wunderground.com"+CHR$ (13)+CHR$(10) PAUSE 1000 GETSTRINGLONG PRINT #1,"+++"; ' return module to accept AT commands mode PAUSE 1200 PRINT #1,"AT+CIPCLOSE" 'close TCP connection PAUSE 100 GETSTRINGLONG END '**********GETSTRINGLONG************ SUB GETSTRINGLONG PAUSE 200 C$="" DO C$=INPUT$(1,#1) char = ASC(C$) IF char >31 THEN PRINT C$; 'printable characters IF char =10 THEN PRINT " " 'linefeed ENDIF LOOP WHILE LOC(#1)<>0 END SUB SUB FLUSHBUF DO:A$=INPUT$(1,#1):LOOP WHILE LOC(#1) <> 0 END SUB '----------------------------------------------------------- -- |
||||
viscomjim Guru ![]() Joined: 08/01/2014 Location: United StatesPosts: 925 |
If you go to www.wunderground.com you can get your very own api key for free which is good for 500 reads a day. Also, if you navigate to their api page, you can see all the different queries you can make and how to do that. The return you get from the GET that is in the program is quite lengthy, you could probably narrow it down quite a bit. For instance, I don't get any of the "neighborhood" stuff which is quite a lot of data you don't need. Also you will notice that their GET is a bit different than mine, just change mine in the query area only, if you use their format, it won't work for you. (Don't know why). |
||||
cwilt Senior Member ![]() Joined: 20/03/2012 Location: United StatesPosts: 147 |
I have not read this entire discussion so forgive me if this has already come up. Would it be possible to program uMite over the air? |
||||
jman![]() Guru ![]() Joined: 12/06/2011 Location: New ZealandPosts: 711 |
Hi Thanks for the tips my modules are now working :) Instead of the code below SERVER$="23.9.235.83" 'Aust. IP for api.wunderground.com Why not use this SERVER$="api.wunderground.com" 'Aust. IP for api.wunderground.com That way DNS will resolve the correct IP not matter were you live Regards Jman |
||||
JohnS Guru ![]() Joined: 18/11/2011 Location: United KingdomPosts: 4044 |
In theory, yes, but the code to do it has not been written (yet). John |
||||
viscomjim Guru ![]() Joined: 08/01/2014 Location: United StatesPosts: 925 |
Hi Jman, thats a good idea, does it work, can't test right now, but very curious. |
||||
paceman Guru ![]() Joined: 07/10/2011 Location: AustraliaPosts: 1329 |
Just made sure of that Jman - it works fine. I didn't want to change viscomjim's quoted code. Greg |
||||
viscomjim Guru ![]() Joined: 08/01/2014 Location: United StatesPosts: 925 |
That is truly awesome. No more pinging. That's what I get for not knowing anything about this stuff. I am definitely learning though, especially with the help from this forum. Great call Jman!!! |
||||
paceman Guru ![]() Joined: 07/10/2011 Location: AustraliaPosts: 1329 |
So here's viscomjim's code again, with Jman's suggestion and tidied more. Note: check the GET statement line. There should be a space only after GET and Json and Host:. The forum software seems to add extras sometimes. Greg 'ESP8266 WiFi Module & MicroMite Web Weather Access Program.
'MicroMite Basic V4.5 (Geoff Graham). ESP82666 F/W V0.922 'Author: viscomjim 16/10/14 '----------------------------------------------------------- -- SERVER$ = "api.wunderground.com" PORTX$ = "80" OPEN "Com1:115200,4096" AS #1 'ESP module must be set to same rate FLUSHBUF 'for F/W V0.9.2.2 use "AT+CIOBAUD=115200" PRINT #1,"AT+CWMODE=3" 'i.e. access point & client PAUSE 100: FLUSHBUF PRINT #1,"AT+CIPMUX=0" 'single connection PAUSE 100: FLUSHBUF PRINT #1,"AT+CIPMODE=1" 'data transmision mode = data mode PAUSE 100: FLUSHBUF PRINT #1,"AT+CIPSTART="+CHR$(34)+"TCP"+CHR$(34)+","+CHR$(34)+SERVE R$+CHR$(34)+","+PORTX$ '...="TCP","SERVER$",80 PAUSE 500: FLUSHBUF PRINT #1,"AT+CIPSEND" 'send data, i.e. GET command as below PAUSE 400 PRINT #1,"GET /api/2b4e1c4572808d14/geolookup/conditions/forcast/q/Austral ia/Melbourne.json HTTP/1.1"+CHR$(13)+CHR$(10)+"Host: "+SERVER$+CHR$(13)+CHR$(10) PAUSE 1000 GETSTRINGLONG PRINT #1,"+++"; 'needed in F/W V0.922 to return to AT commands mode PAUSE 1200 PRINT #1,"AT+CIPCLOSE" 'close TCP connection PAUSE 100 GETSTRINGLONG END '**********GETSTRINGLONG************ SUB GETSTRINGLONG PAUSE 200 C$="" DO C$=INPUT$(1,#1) char = ASC(C$) IF char >31 THEN PRINT C$; 'printable characters IF char =10 THEN PRINT " " 'linefeed ENDIF LOOP WHILE LOC(#1)<>0 END SUB SUB FLUSHBUF DO:A$=INPUT$(1,#1):LOOP WHILE LOC(#1) <> 0 END SUB '----------------------------------------------------------- -- |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6283 |
Provided that the module remembers it's configuration and can automatically connect to the network, it would be very easy to program the uMite. TeraTerm and MMEdit are both happy to talk via TCPIP. I now have a module to play with but no time.... Jim VK7JH MMedit |
||||
viscomjim Guru ![]() Joined: 08/01/2014 Location: United StatesPosts: 925 |
Now we need some creative genius to parse this data from the rx buffer. I am trying to get the data into some string arrays, kind of like Geoff's gps reading but I'm not that good at this yet. It would be nice to be able to pick and choose which parameters you want to read and then pick them out of the returned json data... EDIT... I just tried the new code and it seems like you get a lot more info back than I do when I use a zip code in the US. I don't get any "neighborhood" type info. I don't use the geolookup in the query, maybe that's why. Take a look at the api info on www.wunderground.com and check out the parameters that you can change. This may narrow down the returned info. |
||||
paceman Guru ![]() Joined: 07/10/2011 Location: AustraliaPosts: 1329 |
The module does seem to remember its settings Jim - at least baudrate, local WiFi network SSID, channel, password etc. I turned mine on from a cold start this morning and ran the program and the data came straight in. Greg |
||||
![]() ![]() ![]() ![]() |
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |