Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 07:47 03 Aug 2025 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 : 4 $ WiFi Serial Transceiver Module

     Page 4 of 7    
Author Message
viscomjim
Guru

Joined: 08/01/2014
Location: United States
Posts: 925
Posted: 02:28pm 09 Oct 2014
Copy link to clipboard 
Print this post

Hi Plasma,

Here is a quick solution to your web time server. Yahoo has a time server and with a little change in the code you can get the time. It is meant to use the Unix time, which it does return, but the coolness factor here is that is the second line of the returned data you get this...

Date: Fri, 10 Oct 2014 00:23:32 GMT

You can peel this out of the returned code and set your clock by it.

Here is the new code for this... very easy.


SERVER$="98.139.25.73"
PORTX$="80"

Open "Com1:115200, 4096" As #1
FLUSHBUF

PRINT #1,"AT+CWMODE=3"
PAUSE 100
GETSTRINGLONG

PRINT #1,"AT+CIPMUX=0"
PAUSE 100
GETSTRINGLONG

Print #1,"AT+CIPSTART="+Chr$(34)+"TCP"+Chr$(34)+","+Chr$(34)+SERVE R$+Chr$(34)+","+PORTX$
PRINT "AT+CIPSTART NOW"
PAUSE 1000
GETSTRINGLONG

Z$="GET /TimeService/V1/getTime?appid=YahooDemo HTTP/1.1"+chr$(13)+chr$(10)+"Host: developer.yahooapis.com"+chr$(13)+chr$(10)
OUTPUTX Z$
PAUSE 1000
GETSTRINGLONG

END


Sub OUTPUTX (OUT$)
Print #1,"AT+CIPSEND=0"+Str$(Len(OUT$)+2)
Pause 200
Print #1,OUT$
PRINT OUT$
Pause 100
END SUB

'**********GETSTRINGLONG************
SUB GETSTRINGLONG
PAUSE 200
PRINT "BYTES IN LOC = ";LOC(#1)
C$=""
DO
C$=Input$(1,#1)
char = Asc(C$)
If char >31 Then Print C$;
If char =13 Then Print " "
LOOP WHILE LOC(#1)<>0
END SUB

SUB FLUSHBUF
DO:A$=INPUT$(1,#1):LOOP WHILE LOC(#1) <> 0
END SUB


Good luck and let us know if this worked for you!!!!
 
paceman
Guru

Joined: 07/10/2011
Location: Australia
Posts: 1329
Posted: 02:48pm 09 Oct 2014
Copy link to clipboard 
Print this post


Anyone know of an Australian timeserver that has a nice ASCII time/date stamp like that, that we could substitute?
 
viscomjim
Guru

Joined: 08/01/2014
Location: United States
Posts: 925
Posted: 02:58pm 09 Oct 2014
Copy link to clipboard 
Print this post

Hi paceman, I will GTS and see what I can find. Will keep you posted.

edit...

THIS may be of interest to you. Didn't dig too deep but will check it tomorrow. Personal use is $0.00 per month for up to 2000 queries.

HERE is another one that might work for you.Edited by viscomjim 2014-10-11
 
plasma
Guru

Joined: 08/04/2012
Location: Germany
Posts: 437
Posted: 08:14pm 09 Oct 2014
Copy link to clipboard 
Print this post

Thx a lot !

Well i solved these functions such extern ip,
Unix timestamp calculation , get time and date ,
Md5 hash and other with a little php on my
Own server.
So i get the time or the extern ip from my hown
Network if i send a password to the script.
No dyndns or startic ip is in need.
Maybe the Admin from TBS can create
The same thing for the mmbasic user in down under?

 
paceman
Guru

Joined: 07/10/2011
Location: Australia
Posts: 1329
Posted: 04:56pm 10 Oct 2014
Copy link to clipboard 
Print this post

Thanks Jim, I just received my module in the mail today so will be able to give it a go soon.

Greg
 
viscomjim
Guru

Joined: 08/01/2014
Location: United States
Posts: 925
Posted: 05:46pm 11 Oct 2014
Copy link to clipboard 
Print this post

@paceman, keep us posted on your experience... Very interested!
 
viscomjim
Guru

Joined: 08/01/2014
Location: United States
Posts: 925
Posted: 12:43pm 12 Oct 2014
Copy link to clipboard 
Print this post

A bit more progress after a bit of hair loss on the esp8266...

I updated the unit to "922" and things are a bit better now. Also I discovered that if you use "transparent mode" by using AT+CIPMODE=1, you don't need to send the data (CIPSEND) and the length of the data, just the data. This simplifies things a little. However, to get out of that mode you have to send +++ to get it back into a mode that will accept AT commands (with some pausing). Kind of like the old hayes modems. Also, if you are in CWMODE=3 and you inquire the ip address using AT+CIFSR, you get your ip address and the ip address of the access point. After this update, you will be at 9600 baud, but you can now adjust the speed using AT+CIOBAUD=9600, supported 9600, 19200, 38400, 57600, 74880, 115200, 230400,460800, 921600. Pretty high data rate now, but limited to 230400 on uMite.


To update the firmware, go http://www.electrodragon.com/w/Wi07c#Firmware_Log and go to firmware log. Do not do any of the updates that it shows, including the cloud one. Just go directly to firmware log and download the File:V0.9.2.2 AT FIRMWARE.BIN.ZIP and then download the Firmware uploading tool XTCOM UTIL.ZIP to send the file to the esp8266. Take note of how to wire the module to update the firmware.

Try this program out and just put in your zip code to get your weather. The rem'ed out stuff was for debugging. Still working on parsing this stuff so you can display what you want, but not getting too far with this. Any Ideas would be really helpful right now....


SERVER$="23.0.88.120"
PORTX$="80"

Open "Com1:115200, 4096" As #1
FLUSHBUF

INPUT "PLEASE ENTER YOUR ZIP CODE";ZIP$

PRINT #1,"AT+CWMODE=3"
PAUSE 100
'GETSTRINGLONG
FLUSHBUF


PRINT #1,"AT+CIPMUX=0"
PAUSE 100
'GETSTRINGLONG
FLUSHBUF

PRINT #1,"AT+CIPMODE=1"
PAUSE 100
'GETSTRINGLONG
FLUSHBUF

Print #1,"AT+CIPSTART="+Chr$(34)+"TCP"+Chr$(34)+","+Chr$(34)+SERVE R$+Chr$(34)+","+PORTX$
'PRINT "AT+CIPSTART NOW"
PAUSE 500
'GETSTRINGLONG
FLUSHBUF

PRINT #1,"AT+CIPSEND"
PAUSE 400
PRINT #1,"GET /api/2b4e1c4572808d14/conditions/q/"+ZIP$+".json HTTP/1.1"+chr$(13)+chr$(10)+"Host: api.wunderground.com"+chr$(13)+chr$(10)
PAUSE 1000
GETSTRINGLONG

PRINT #1,"+++";
PAUSE 1200


Print #1,"AT+CIPCLOSE"
PAUSE 100
GETSTRINGLONG

END

'**********GETSTRINGLONG************
SUB GETSTRINGLONG
PAUSE 200
'PRINT "BYTES IN LOC = ";LOC(#1)
C$=""
DO
C$=Input$(1,#1)
char = Asc(C$)
If char >31 Then Print C$;
If char =10 Then PRINT " "
ENDIF
LOOP WHILE LOC(#1)<>0
END SUB

SUB FLUSHBUF
DO:A$=INPUT$(1,#1):LOOP WHILE LOC(#1) <> 0
END SUB


I forgot to add that in the mode described above, you no longer get the +IDP crap and the related pause when you are receiving the data back. This should help simplify the data parsing.... Also, the terminal program that Jeff OldBitCollector was kind enough to write won't work like it used to as I found out. I used teraterm to initially talk to the esp and realize that you have to send the command and then cr+lf to get any response back. I know this is a pain to redo stuff, but I am going to assume that this is the direction these guys are going and I need to keep up with them. Don't be dismayed if you get no response after the update, you just have to add this and it will work.

EDIT...

for some reason the same space thing happened when copy paste the code...
In the 18th line of code, the one with AT+CIPSTART, there is extra space at Print and #1 and also in the word "SERVE R$" should be "SERVER$".

EDIT somemore...

After update, ATE1 and ATE0 work for echo on and echo off. Also I am now running this module at 230400 baud with NO problem...Edited by viscomjim 2014-10-14
 
plasma
Guru

Joined: 08/04/2012
Location: Germany
Posts: 437
Posted: 11:15am 13 Oct 2014
Copy link to clipboard 
Print this post

what do you think about a command to find a string in the buffer?
i download severall files , but the header size isnt the same because i contain some variables ( time, date)
and so on.
so i cant cut the header from the data without fiddeling the string and searching for my startstring.
the only problem is imho you need a big buffer which contains all data . in this case the string length limit
from 255 bytes isnt enough.
well i know you can create abbigger buffer and read it with mmbasic commands but this is not much comfortable.
another idea is to put an array other the memory from the buffer such like : dim data @ pointer from the channel.
 
viscomjim
Guru

Joined: 08/01/2014
Location: United States
Posts: 925
Posted: 04:02pm 13 Oct 2014
Copy link to clipboard 
Print this post

Take a look at the way Geoff reads the rx buffer in his super duper gps clock. I think this is a good starting point by putting info into an array and messing with it after it is captured. I am trying very hard to implement this, but as of yet not having very good luck doing so. However, with perseverance, we will kick this in the ass. I will keep you posted as to my progress, if you could do the same. This does open a few IoT doors for the uMite, so I will do my best. I'm not trying to create a web browser or anything like that, but to be able to communicate with apis and upload and download control information over the web would be extremely cool. Those damn arduinos have been doing this for a long time, now its uMite time damn it!Edited by viscomjim 2014-10-15
 
plasma
Guru

Joined: 08/04/2012
Location: Germany
Posts: 437
Posted: 07:13pm 13 Oct 2014
Copy link to clipboard 
Print this post

last night i trying to load a 64k file from my server .
the data are messy sometimes and i dont get all 64kb all the time.
sometimes i get <1kb sometime > 5 kb data . iam working on this night and show the code here .
also i get my ip after > 5 secs after a reboot and log in , but i can send and receive before it shows me my ip ( At+CIFSR).
i set the console to 230400 baud to avoid transmission errors and playing also with the buffersize.
iam not updatet the module yet but i will do this to become the same level as you .
thx
 
paceman
Guru

Joined: 07/10/2011
Location: Australia
Posts: 1329
Posted: 01:35am 14 Oct 2014
Copy link to clipboard 
Print this post

I hooked mine up and got it running with the Micromite today - using a USB to TTL serial adapter on my Win XP notebook. I'm following OBC's Instructable and apart from a few glitches it seems to be doing the right things. So far the chat window in Tassy Jim's MMEdit seems to be working fine as a terminal too (using OBC's Simple Terminal program) and PINGs are working OK on my network (Billion 7800N router). Also I've just loaded and run the "Simple Webserver" program and managed to get the "Welcome to my Webserver..." message back using Firefox. Haven't set up port-forwarding yet.

The current draw doesn't seem as high as others have mentioned. It was pulling around 70mA un-configured but typically 35-50mA now it's set up. No sign of the 250mA that's been mentioned - maybe they de-rated it for Australia!

Putting it to bed now ready for another great leap forward tomorrow.

GregEdited by paceman 2014-10-15
 
viscomjim
Guru

Joined: 08/01/2014
Location: United States
Posts: 925
Posted: 09:54am 14 Oct 2014
Copy link to clipboard 
Print this post

If you guys decide to update your esp8266 modules to the most current firmware, make sure you get OBC's updated terminal program. All firmware updating info is discussed in this thread and also HERE . Same page has OBC's code for the terminal. If you have any question about the updating process, don't hesitate ask, it took me a few go arounds but now I have it down pat. You can save some time by just going right to 922 version.
 
paceman
Guru

Joined: 07/10/2011
Location: Australia
Posts: 1329
Posted: 01:28pm 14 Oct 2014
Copy link to clipboard 
Print this post

I'll do that Jim but just getting the initial hurdles jumped first. I've had a fair play with my router settings (via the browser interface) in the past, but AT commands and HTML are totally new to me.

Greg
 
plasma
Guru

Joined: 08/04/2012
Location: Germany
Posts: 437
Posted: 03:36am 15 Oct 2014
Copy link to clipboard 
Print this post

ive updated to the latest version but cant connect to the esp8266 even with 9600 baud.
also i need to warning here if you have a esp-05 u cant update without solderin on it because
it has anly the seriall connect pin on board..

@viscomjim ive updated to the firmware you recommended . i use teraterm to connect it with 9600 baud
i can press some keys it shows the right string whats all. any idea
 
plasma
Guru

Joined: 08/04/2012
Location: Germany
Posts: 437
Posted: 03:46am 15 Oct 2014
Copy link to clipboard 
Print this post

got it , you need to set up CR+LF in the Terminal.

now testing....
 
paceman
Guru

Joined: 07/10/2011
Location: Australia
Posts: 1329
Posted: 03:51am 15 Oct 2014
Copy link to clipboard 
Print this post

Trying to update to v0.9.2.2 using the USB-TTL adapter and my Win XP system,but having trouble with the XTCOM_UTIL program.
XTCOM_UTIL's running fine but In Tools/Configure Device it only gives options from COM1 to COM6. My Silicon Chip serial port driver is at COM15 though and when I enter COM15 and the 115,200 baud rate and hit OPEN it returns:

"Operation Failed!
XTCOM_API_ComInit()gets an error code: 0"

TeraTerm talks to it fine on COM15 - any ideas how to get around this?

GregEdited by paceman 2014-10-16
 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2944
Posted: 04:19am 15 Oct 2014
Copy link to clipboard 
Print this post

Greg,

If you go to control panel (with your USB module plugged in) then select the 'virtual' COM port that windows has assigned it and look for 'Advanced Settings' under Port Settings. You should then see a long list of COM ports on a drop-down (with COM15 selected by default as this is what Windows has assigned it). Simply select a lower COM port number (you may get a warning message but ignore that). I always use COM 3 as Com 1 & Com 2 are used by built-in hardware on my laptop).

Selecting any number under 8 should work (the lower the better). It is all to do with the way software/drivers are written.

Hope this helps . . . . .
 
viscomjim
Guru

Joined: 08/01/2014
Location: United States
Posts: 925
Posted: 04:25am 15 Oct 2014
Copy link to clipboard 
Print this post

Hi Paceman, I have not run in to this situation before as mine always comes up at com6. I would try the WW method. I hope that works for you. Please keep us posted....

Hi Plasma, I'm glad you found the CR+LF. That drove me nuts for a bit also. Keep us posted on your progress... P.S. if you are using OBC's terminal, don't forget to get the new one, link in earlier post in this thread.Edited by viscomjim 2014-10-16
 
viscomjim
Guru

Joined: 08/01/2014
Location: United States
Posts: 925
Posted: 04:50am 15 Oct 2014
Copy link to clipboard 
Print this post

I haven't tried this yet, but for those in Australia, if you change the 18th line of weather program on page 6 of this thread (the one with the GET in it) to...

PRINT #1,"GET /api/2b4e1c4572808d14/geolookup/conditions/forcast/q/Austral ia/Sydney.json HTTP/1.1"+chr$(13)+chr$(10)+"Host: api.wunderground.com"+chr$(13)+chr$(10)

this should work for you. If it doesn't you can try to get a new ip address that is used in the beginning of the program for wunderground as it might be different over there??? The way I found it in windows was I pinged (cmd, ipconfig, ping) api.wunderground.com and it showed the ip address that I used in the program. On a mac you can use network utility and just type in api.wunderground.com and hit ping.

If someone does actually do this, can you let me know if it worked and if you indeed had to acquire a new ip address for them.

Thanks!!!!!!


EDIT... Get rid of space in the word Australia. Can't seem to edit that for some reason.

EDIT2... I tried this when I got home and it works. Just rem out the input line for zip code as it is not used here.
15C, wind NNW at 7mph, Scattered clouds, 59% relative humidity, etc.... yeah!Edited by viscomjim 2014-10-16
 
paceman
Guru

Joined: 07/10/2011
Location: Australia
Posts: 1329
Posted: 02:12pm 15 Oct 2014
Copy link to clipboard 
Print this post

@WW,

Thanks Phil, that did the job immediately. There were a whole string of COM ports there and were listed as "in use" (phantoms from the past no doubt). I just overwrote the COM5, set that up in the VTCOM utility and the upload went like a dream - maybe a minute or perhaps less.

@viscomjim,

Set up TeraTerm for 9600 and the CRLF change and we're talking to the module again. Interestingly when you do an "AT+GMR" to check the firmware version, it comes back with the same number as the earlier version, i.e. it returns 0018000902 - I would have thought it would end with 922 but then on the ElectroDragon Wi07c page it does say:
File:V0.9.2.2. AT Firmware.bin.zip (0018000902 modified 0.922) which is a bit cryptic but ?....

Now to start playing again.

Greg

 
     Page 4 of 7    
Print this page
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025