ESP8266 WiFi serial module

manuka

Senior Member
An alert to Shanghai firm Espressif Sytem's versatile,CHEAP & powerful ESP8266 WiFi serial module. Check extensive forum support here. Reports indicate several hundred meters range with just the PCB antenna on the breadboard friendly ESP-01. This certainly betters the performance of cheap HC-05 style Bluetooth modules! Stan.
 

Attachments

Last edited:

manuka

Senior Member
For initial (or portable) trials recall that 3.2V is the stable terminal voltage of an energetic LiFePO4 cell. A couple of alkaline AAs could also be used. Stan.
------------------------------------------------------------------------------------

Extra: This seems a fast moving field, as 11 module variations are now available -

ESP-01 PCB antenna, 8 pin serial port,upgrade leads and a reset

ESP-02 external antenna

ESP-03 leads to all available IO ports,with high-gain ceramic antenna. Suits SDK use

ESP-04 leads to all IO ports, customer designed antenna

ESP-05 interface only with leads for UART and VCC

ESP-06: bottom mount technology, leads to all IO ports, with metal shielding.

ESP-07: Semi-hole chip technology,leads to all the IO, with metal shielding.

ESP-08: same as ESP-07, except customer specified antenna.

ESP-09: Ultra-small size package, only 10x10 mm, four-layer board & 1M bytes!

ESP-10: SMD interface, narrow-body design, 10 mm wide.

ESP-11: SMD interface, ceramic antenna, small size.
 
Last edited:

REB100

New Member
Yes, the ESP-01 can be used with a Picaxe.

I got it working today.

DS18B20 to picaxe to ESP-01 to Raspberry Pi.
 

REB100

New Member
First time posting code . Hope I get it right.
Code:
symbol Temp = B.4
symbol Batt_Volt = B.3
symbol TCP_Send = B.2
symbol ID = b6

let ID = 001
TransNum =1


Startup:

pause 5000

serout TCP_Send,T4800_4,("AT+RST",13,10)

pause 5000

serout TCP_Send,T4800_4,("AT+CWMODE=1",13,10)

pause 5000

serout TCP_Send,T4800_4,("AT+CWJAP=",34,"your_ssid",34,",",34,"your_password",34,13,10)

pause 10000

Main:

readtemp Temp,b11

readtemp12 Temp,w4

serout TCP_Send,T4800_4,("AT+CIPMUX=1",13,10)

pause 5000

serout TCP_Send,T4800_4,("AT+CIPSTART=1,",34,"TCP",34,",",34,"1xx.1xx.1xx.1xx",34,",","xxxx",13,10)

pause 5000

serout TCP_Send,T4800_4,("AT+CIPSEND=1,7",13,10)

pause 500

bintoascii b8,b12,b13,b14
serout TCP_Send,T4800_4,(b12,b13,b14)  

serout TCP_Send,T4800_4,(",")

bintoascii b9,b12,b13,b14
serout TCP_Send,T4800_4,(b12,b13,b14)  

pause 5000

'serout TCP_Send,T4800_4,("AT+CIPCLOSE=1",13,10)


Nap 10   '16s nap
rem Nap 11   '32s nap
rem Nap 12  '64s nap


goto main
Lots of work left to do on this code. Consider it a guide , not a finished solution.

I should mention my hardware setup.
In addition to a regular Picaxe programming cable I have the TX pin on the ESP-01 connected to a FTDI board which connects to a terminal program on the Windows computer.
This lets me see all the output from the ESP-01 in real time. This makes finding errors much quicker. The Picaxe does not connect to the TX pin on the ESP-01.
 

beb101

Senior Member
Another nice thing about the Lua firmware is that you can use it as a floating point co-processor.
Just send this out of the Picaxe serial port connected to the ESP,

print(135711.22145/4421.33)

and get back the answer,

30.694660079659

print(135711.22145/4421.33/30.694660079659)
1

Exponentiation
print(30.694660079659^0.5)
5.5402761735909

Modulus
print(11 % 3 )
2
print(11223.11%5.552)
2.5180000000018

The full math module is not implemented, just the basic operations.
 

julianE

Senior Member
REB100, thanks so much for posting your code. I have been struggling with the 8266 for a couple weeks now. I too have a setup similar to yours where I use the FTDI cable to capture information and troubleshoot. I have been trying to post data on thingspeak site and have it working but it's not perfect, every so often i'd receive an error from the 8266 and it would fail to send data. If i send the data straight to the ftdi from the 08M2 it's flawless, I'm guessing it's a timing issue of sorts. I noticed you use a 4800 baud rate instead of the default 9600, do you find it works better at that speed.

I will try your code and see if it works better on my setup. Again, thanks for posting.

Lua is intriguing too but i best solve the AT issue.
 

REB100

New Member
Most of my errors from the 8266 come from it still being busy when I send it a new command. That is why I have such long pause statements in my code. As for 4800 baud, I am usually sending between 8-30 bytes at a time and 4800 is more than fast enough to keep up.
 

REB100

New Member
I buy from eBay, no special seller. Usually China based. Most USA sellers have high shipping rates to Canada.
 

Hemi345

Senior Member
Most of my errors from the 8266 come from it still being busy when I send it a new command. That is why I have such long pause statements in my code. As for 4800 baud, I am usually sending between 8-30 bytes at a time and 4800 is more than fast enough to keep up.
When I serout the commands, I gosub to a do loop with serin check that has a short timeout and the qualifier "Ready" or "Ok". Basically it'll wait till it gets confirmation the command was successful before it continues with the next command. The do loop will break automatically after a certain time and the process will start over if it went off the rails so it will recover gracefully. I'll post a code snippet tonite if I get a chance.
 

jims

Senior Member
I currently use Picaxe ERF modules to communicate between a 20m2 and an 08m2. Works very well. I use these two routines to test the RF xmit & rcv. The ESP8266 looks like a possible lower cost alternative. Will this test code work on the 8266 if I can figure out the physical interface that's necessary due to the lower voltage required for the 8266? Thank you, JimS

Code:
'***********************************************
'* 20m2.Terminal "A". Test RF communication
'* between terminal "A" and terminal "B" using
'* Picaxe ERF modules. Bicolor R/G LED used to 
'* indicate RF activity.
'***********************************************
symbol oled = B.4
symbol rcv_pin = C.6
symbol xmit_pin = C.7
symbol rled = B.6
symbol gled = C.2

#picaxe 20m2	'Terminal "A".
pause 1000
low C.7	'Set xmit pin low.
serout oled,n2400, (254,1):pause 30 'Clear OLED.
 
Main:
	let b0=0:let b1=10
	let b2="A":let b3="M"
	do
	 high gled: low rled
	 setfreq M32	'** Set freq to M32 to rcv RF with ERF module.
	 serin rcv_pin,N9600_32,("A") 'Wait for "A" from terminal "B".
	 pause 2000		'Pause 2 seconds before xmit response to "B".
	 setfreq M8	'** Decrease freq to M8 to xmit RF with ERF module.
	 serout xmit_pin,N9600_8,("B",b0,b1,b2,b3)	'Xmit "B" & 4 bytes to "B".
	 setfreq M4		 '** Return to M4 for regular processing.
	 low gled: high rled
	 pause 1000
	 inc b0:inc b1:inc b2:inc b3
	loop until b0=11
	goto main
Code:
'*********************************************
'* 08m2.Terminal "B". Test RF communication
'* between terminal "A" and terminal "B" using
'* Picaxe ERF modules. Show rcv data on an 
'* OLED display.
'*********************************************

symbol oled = C.1		'pin 6.
symbol rcv_pin = C.3	'pin 4
symbol xmit_pin = C.2	'pin 5.

#picaxe 08m2	'Terminal "B".
pause 1000
low C.2	'Set xmit pin low.
serout oled,n2400, (254,1):pause 30 'Clear OLED.
 
Main:
	do
	 serout oled,n2400, (254,1):pause 30 'Clear OLED.
	 serout oled,n2400, (254,128,"    WAITING      "):pause 10
	 setfreq M8	'** Set freq to M8 to xmit RF with ERF module.
	 serout xmit_pin,N9600_8,("A")	'Xmit "A" to terminal "A".
	 setfreq M32	'** Increase freq to M32 to rcv with ERF module.
	 serin rcv_pin,N9600_32,("B"),b0,b1,b2,b3	'Wait for qualifier response from "A".
	 setfreq M4		 '** Return to M4 for regular processing.
	 serout oled,n2400, (254,128,"RCV: ",#b0," ",#b1," ",b2," ",b3," "):pause 10
	 pause 2000
	loop
 

REB100

New Member
I currently use Picaxe ERF modules to communicate between a 20m2 and an 08m2. Works very well. I use these two routines to test the RF xmit & rcv. The ESP8266 looks like a possible lower cost alternative. Will this test code work on the 8266 if I can figure out the physical interface that's necessary due to the lower voltage required for the 8266? Thank you, JimS

You can run the Picaxe and the ESP8266 on 3 Volts using two AA cells.

I haven't tried to use the ESP-8266 to send data between picaxes. Not sure how that would work.

My current project has a picaxe sending data directly to a TCP server running on a Raspberry Pi.
 

Hemi345

Senior Member
Sounds like an interesting project--can you post more than a snippet?
Sure, I'm swamped with my daughter's stuff this week, but will get it off the laptop this weekend. It's similar to what REB100 is doing but I use a GET with name value pairs and a unique ID for the PICAXE project that is sending it, then also process the response back for any new configuration data (also presented as name value pairs after a qualifier) that is meant for that PICAXE. I'll plan to do a full write up of what I'm working on for the finished projects section.

I currently use Picaxe ERF modules to communicate between a 20m2 and an 08m2. Works very well. I use these two routines to test the RF xmit & rcv. The ESP8266 looks like a possible lower cost alternative. Will this test code work on the 8266 if I can figure out the physical interface that's necessary due to the lower voltage required for the 8266? Thank you, JimS
You can run the Picaxe and the ESP8266 on 3 Volts using two AA cells.

I haven't tried to use the ESP-8266 to send data between picaxes. Not sure how that would work.
There's an AP mode the ESP8266 can be put in (I believe it uses something like 192.168.4.1 for it's own IP, then hands out IPs using built-in DHCP). Configure one PICAXE ESP8266 for AP mode and use the regular station mode for the 2nd PICAXE to connect to the first for point to point comms.

Otherwise, you could put both ESP8266s in station mode and talk between them using your home access point.
 

Hemi345

Senior Member
Here's the basic program that 'posts' data to the webserver and then reads in the response as fast as possible as proof of concept and error handling. Since this is for a battery powered project, I wanted to make sure it spent as little time as possible connecting, posting the data, and getting configuration data back but also being reliable in case it takes a bit longer to get the DHCP address or waiting for the response back from the webserver. Programming in pauses wastes time/battery power and can be unreliable. The code below runs in about 5 seconds from start to finish if there isn't lag on connecting to the AP or waiting for the response back from the webserver so that is acceptable. The unique ID that is posted to the webserver in this example is "345" and it gets back configuration parameter of "003". The "003" is related to a setting I can configure through the website so the next time the PICAXE 'checks in', I can tweak an aspect of the running program. The following was integrated into a much bigger program but since I'm still tweaking it, I'll wait to post it.

Code:
#picaxe 20m2
#no_data
'#no_table
#terminal 19200
#define verboseOut
#rem
Fast power up, post data, receive response, power down for ESP8266
#endrem
setfreq m16
'constants
symbol cMode		= 1		'1=station, 2=AP, 3=station and AP
symbol cMux 		= 1		'0=single connection channel, 1=multiple connection channels
symbol cChannel		= 0		'channel ID
symbol cUID		= 345		'unique ID for PICAXE
symbol cComms 		= T9600_16	'true comms
symbol cTimeout		= 20000 	'5 seconds @ 16mhz
'variables
symbol vStep		= b19		'case step
symbol vConfirmLoop	= b20		'number of loops for confirm message check
symbol vConfirmVar1	= b22		'first byte of confirm message (like OK or no) to look for
symbol vConfirmVar2	= b23		'2nd byte of confirm message to look for
'pins
symbol pRX 		= B.0 		'connect to TX on ESP8266
symbol pTX		= B.1 		'connect to RX on ESP8266
pause 2000 				'1/2 second @ 16mhz
#ifdef verboseOut
	sertxd (13,10,"Powered up.",13,10)
#endif
vStep 			= 0		'start at case step 0
do 
vConfirmLoop = 0
main:
	select case vStep
		case 0
			vConfirmVar1 = "n"	'no change
			vConfirmVar2 = "o"
			#ifdef verboseOut
				sertxd ("Set Mode")
			#endif
			serout pTX,cComms,("AT+CWMODE=",#cMode,13,10)
			gosub confirmCMD
		case 1
			vConfirmVar1 = "O"	'OK
			vConfirmVar2 = "K"
			#ifdef verboseOut
				sertxd ("Connecting")
			#endif
			serout pTX,cComms,("AT+CWJAP=",34,"ap ssid here",34,",",34,"ap password here",34,13,10)
			gosub confirmCMD
		case 2
			#ifdef verboseOut
				sertxd ("Set Mux")
			#endif
			serout pTX,cComms,("AT+CIPMUX=",#cMux,13,10)
			gosub confirmCMD
		case 3
			#ifdef verboseOut
				sertxd ("Send Start")
			#endif
			serout pTX,cComms,("AT+CIPSTART=",#cChannel,34,"TCP",34,",",34,"www.your webserver here.com",34,",80",13,10)
			gosub confirmCMD
		case 4
			#ifdef verboseOut
				sertxd ("Send Length")
			#endif
			serout pTX,cComms,("AT+CIPSEND=",#cChannel,",44",13,10)
			#ifdef verboseOut
				sertxd (", Send GET")
			#endif
			serout pTX,cComms,("GET http://www.your webserver here.com/req.cfm?key=",#cUID,13,10)
			serin [cTimeout,main],pRX,cComms,("ZZZ"),b0,b1,b2,b3 'qualifier "ZZZ", the next few chars will be : & config values
			sertxd (" OK",13,10,"Data",b0," ",b1,b2,b3,13,10)
			if b0 = ":" then
				#ifdef verboseOut
					sertxd ("Close Conn")
				#endif
				serout pTX,cComms,("AT+CIPCLOSE=",#cChannel,13,10)
				gosub confirmCMD
			endif
			end	'stop program and put PICAXE in low power mode
	end select
loop
end

confirmCMD:
	inc vConfirmLoop
	if vConfirmLoop < 4 then
		#ifdef verboseOut
			sertxd (".")	'output waiting indicator
		#endif
		serin [cTimeout,confirmCMD],pRX,cComms,(vConfirmVar1,vConfirmVar2)	'wait for qualifiers
		#ifdef verboseOut
			sertxd(" ",vConfirmVar1,vConfirmVar2,13,10) 'show msg indicating command was confirmed successfully
		#endif
		inc vStep
		vConfirmLoop = 0
	endif
	return
Here's what is seen in the console:

Code:
Powered up.
Set Mode. no
Connecting. OK
Set Mux. OK
Send Start. OK
Send Length, Send GET OK
Data: 003
Close Conn. OK
 

lbenson

Senior Member
Thanks much for that, Hemi--very clean, well-structured, well-commented. A very useful skeleton for someone to add flesh to.
 

mrburnette

Senior Member
Another nice thing about the Lua firmware is that you can use it as a floating point co-processor.
Just send this out of the Picaxe serial port connected to the ESP,

print(135711.22145/4421.33)

and get back the answer,

30.694660079659

print(135711.22145/4421.33/30.694660079659)
1

Exponentiation
print(30.694660079659^0.5)
5.5402761735909

Modulus
print(11 % 3 )
2
print(11223.11%5.552)
2.5180000000018

The full math module is not implemented, just the basic operations.
I wrote a blog post here a long ago about using a pre-programmed Atmega328-P as a math co-processor gor PICAXE. The interface is serial, the program is open to allow for extending the verbs to include new functions... the IEEE 32-bit library is used, so results are fairly accurate.

Ray
 

julianE

Senior Member
I've been working with the 8266 and Picaxe 08M2 for a while now and have had spotty success. Today I tried the newest 8266 I received from China, complete disaster, here is the firmware version,
AT+GMR
AT version:0.23.0.0(Apr 24 2015 21:11:01)

the reply messages changed, posting data changed even the method of changing the baud rate changed. I threw in the towel and reverted to an older firmware,

AI-v0.9.5.0 AT Firmware

I tried 0.9.2.2 but that was a bust.

My question, what is the latest/best firmware for using with Picaxe? Where do I downloaded from, it seems like the firmware is scattered all over the net.

Also, I tried LUA on the 8266 and that was just awful, kept getting out of memory errors and other errors. I used it stand alone, perhaps it will work better as a helper to the picaxe.

Thanks in advance.
 

1968neil

Senior Member
Hi Julian,
I Use LUA as a standalone platform and find it quite reliable.
Try this code as a starting point, i use this as a remote switch and it has performed flawlessly for a few months now.
The 3v3 psu is critical to its operation as is making sure that the CH_PD is tied to 3v3 also.

Code:
wifi.setmode(wifi.STATION)
wifi.sta.config("Your Router name","Your password")
print(wifi.sta.getip())
led1 = 3
led2 = 4
gpio.mode(led1, gpio.OUTPUT)
gpio.mode(led2, gpio.OUTPUT)
srv=net.createServer(net.TCP)
srv:listen(80,function(conn)
    conn:on("receive", function(client,request)
        local buf = "";
        local _, _, method, path, vars = string.find(request, "([A-Z]+) (.+)?(.+) HTTP");
        if(method == nil)then
            _, _, method, path = string.find(request, "([A-Z]+) (.+) HTTP");
        end
        local _GET = {}
        if (vars ~= nil)then
            for k, v in string.gmatch(vars, "(%w+)=(%w+)&*") do
                _GET[k] = v
            end
        end
        buf = buf.."<head>";
        buf = buf.."<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">";
        buf = buf.."<script src=\"https://code.jquery.com/jquery-2.1.3.min.js\"></script>";
        buf = buf.."<link rel=\"stylesheet\" href=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css\">";
        buf = buf.."</head><div class=\"container\">";

        buf = buf.."<h1>Julians Web Server</h1>";
        buf = buf.."<h2>GPIO 0</h2>";
        buf = buf.."<div class=\"row\">";
        buf = buf.."<div class=\"col-md-2\"><a href=\"?pin=ON1\" class=\"btn btn-block btn-lg btn-success\" role=\"button\">ON</a></div>";
        buf = buf.."<div class=\"col-md-2\"><a href=\"?pin=OFF1\" class=\"btn btn-block btn-lg btn-danger\" role=\"button\">OFF</a></div>";
        buf = buf.."</div>";
        buf = buf.."<h2>GPIO 2</h2>";
        buf = buf.."<div class=\"row\">";
        buf = buf.."<div class=\"col-md-2\"><a href=\"?pin=ON2\" class=\"btn btn-block btn-lg btn-primary\" role=\"button\">ON</a></div>";
        buf = buf.."<div class=\"col-md-2\"><a href=\"?pin=OFF2\" class=\"btn btn-block btn-lg btn-warning\" role=\"button\">OFF</a></div>";
        buf = buf.."</div></div>";
        
        local _on,_off = "",""
        if(_GET.pin == "ON1")then
              gpio.write(led1, gpio.HIGH);
        elseif(_GET.pin == "OFF1")then
              gpio.write(led1, gpio.LOW);
        elseif(_GET.pin == "ON2")then
              gpio.write(led2, gpio.HIGH);
        elseif(_GET.pin == "OFF2")then
              gpio.write(led2, gpio.LOW);
        end
        client:send(buf);
        client:close();
        collectgarbage();
    end)
end)
Im currently playing with the picaxe /Esp8266 AT command set and as you say its a mind field, will post more when i have any viable results.
Regards
Neil
 

julianE

Senior Member
Thanks Neil, your sample code worked right away. My next step is to try again sending data to thingspeak.
 

1968neil

Senior Member
Glad that helped, Ill post some code later tonight for posting to thingspeak, quite exciting this wifi stuff, just need to incorporate a picaxe somewhere :)

Regards
Neil
 

julianE

Senior Member
Hi Neil,
I have a picaxe output going to the ESP8266 and I learned that you can't do a continuous loop and scan for the transition instead interrupts have to be used due to the fact that the 8266 is busy with the WiFi , etcetera. I have the scanning of the 8266 GPIO port working and it can detect a pulse from picaxe. Once i try to send that information to the thingspeak, lua crashes, with this error,
Connection: kPANIC: unprotected error in call to Lua API (not enough memory)

Here is the lua code that I pieced together from various samples on the web.
I'm fairly certain the code is faulty but everything I tried to fix it fails. BTW, the thingspeak code alone works so I tried breaking it up into two programs, have one with just the interrupt scanning of the GPIO dofile the scanspeak section, fails.

Code:
function onChange ()
conn=net.createConnection(net.TCP, 0) 
conn:on("receive", function(conn, payload) print(payload) end) 
conn:connect(80,'184.106.153.149') 
conn:send("GET /update?key=scanspeak feed&field1=16 HTTP/1.1\r\n") 
conn:send("Host: api.thingspeak.com\r\n") 
conn:send("Accept: */*\r\n") 
conn:send("User-Agent: Mozilla/4.0 (compatible; esp8266 Lua; Windows NT 

5.1)\r\n")
conn:send("\r\n")

end

gpio.mode(3, gpio.INT)
gpio.trig(3, 'both', onChange)
 

1968neil

Senior Member
Hi Julian,

Yes the interrupt is required,
Try the code below, i use this to send an email when a PIR detector is triggered in my garage,
Havent used thing speak but if you change the address and the API key it should work just fine.
Or set up an IFFT account (its free) https://ifttt.com/

Code:
wifi.setmode(wifi.STATION)
wifi.sta.config("YOUR_NETWORK_NAME","YOUR_NETWORK_PASSWORD")
pin = 4   
gpio.mode(pin, gpio.INT)

function onChange ()
    -- A simple http client
    print('Motion Detected')
    conn = nil
    conn=net.createConnection(net.TCP, 0)
    conn:on("receive", function(conn, payload) end)
    conn:connect(80,"maker.ifttt.com")
    conn:on("connection", function(conn, payload)
        conn:send("POST /trigger/motion_detected/with/key/YOUR_API_KEY HTTP/1.1\r\nHost: maker.ifttt.com\r\nConnection: keep-alive\r\nAccept: */*\r\n\r\n") end)
    conn:close()
    print('Email Sent')
end
gpio.trig(pin, 'up', onChange)
Have fun
 

grim_reaper

Senior Member
Code:
...
conn:send("GET /update?key=scanspeak feed&field1=16 HTTP/1.1\r\n") 
conn:send("Host: api.thingspeak.com\r\n") 
conn:send("Accept: */*\r\n") 
conn:send("User-Agent: Mozilla/4.0 (compatible; esp8266 Lua; Windows NT 
...
I have absolutely no experience with LUA at all, but I was instantly suspicious when I read the section of code above! You seem to making a GET request to the thingspeak web site over HTTP, and specifying that you are a Mozilla client. That will return a full blown web page - probably full of script and other assorted gizmos - which would be hard for your system to process, hence the memory error.

Don't ask me what the solution to that is, but hopefully it might point you in the right direction!
 

julianE

Senior Member
thanks for all the help. i have been struggling to get it working but not there yet. i will continue working at it and will post once i sort it out.
 

Pongo

Senior Member
I have absolutely no experience with LUA at all, but I was instantly suspicious when I read the section of code above! You seem to making a GET request to the thingspeak web site over HTTP, and specifying that you are a Mozilla client. That will return a full blown web page - probably full of script and other assorted gizmos - which would be hard for your system to process, hence the memory error.
That's really not a good assumption, just because it has a url doesn't mean it will return a webpage. It's actually accessing the api (which is a subdomain), rather than the main thingspeak.com page, which does not serve a webpage.

You can use wget, or curl, (both available for windows) to send GET commands to a webserver and observe the response. To troubleshoot I would suggest using one of those to simulate the parameters you are sending to thingspeak and see if the server accepts them.
 

inglewoodpete

Senior Member
WiFi Serial 101 Anyone?

I'm displaying my ignorance here but we all have to start somewhere. Almost all of the discussion here and on the ESP8266 website seems to be at an expert or aspiring expert level.

Put very simply, can the ESP8266 be used to communicate between a PICAXE and a mobile/cellphone terminal App in either simplex or duplex (Ie 1 or 2 way)?

Any help is appreciated.
 

julianE

Senior Member
That's really not a good assumption, just because it has a url doesn't mean it will return a webpage. It's actually accessing the api (which is a subdomain), rather than the main thingspeak.com page, which does not serve a webpage.

You can use wget, or curl, (both available for windows) to send GET commands to a webserver and observe the response. To troubleshoot I would suggest using one of those to simulate the parameters you are sending to thingspeak and see if the server accepts them.
I like the cURL suggestion for testing. I've used it for other applications and cURL is a lifesaver.
as far as the issue at hand, i can post information to thingspeak with Lua it's when I get fancy and use the interrupt routine that things go foul. Truth be told it's all due to my incompetence with Lua, supposedly an easy language...I have not seen an easy language since 1990. It seems easy enough and yet I keep failing. Every time I stray from basic i get frustrated. I was overjoyed with Python but it did not last. So it goes.
 

srnet

Senior Member
Put very simply, can the ESP8266 be used to communicate between a PICAXE and a mobile/cellphone terminal App in either simplex or duplex (Ie 1 or 2 way)?
The ESP8266 is of course a serial device, and whilst it was on another platform I have used serial commands to push output from a Micro onto a public webpage.

So assuming the PICAXE can handle the baud rate, the question is really 'how do I control the ESP8266 via serial commands'

The ones I have come setup for 115200 baud, so your going to need an X2 with hardware serial to work with the device, you can change the ESP firmware and baud rate, but that seems to be a lot of pain.

And yes, the minority of those who are famiiar with Web page operation may well assume its all easy peasy.
 

julianE

Senior Member
The ones I have come setup for 115200 baud, so your going to need an X2 with hardware serial to work with the device, you can change the ESP firmware and baud rate, but that seems to be a lot of pain.
Baud rate can be changed to 9600 or anything I guess and is not terribly difficult. If the LUA is flashed to ESP8266 it comes up as 9600 as default. Most do come up at 115200 as default.
The Picaxe works very well with the 8266 at 9600 baud with standard AT commands but the LUA version is more stable, there are way too many different versions of the 8266 AT firmware.
And yes, far from easy peasy. i happen to have a 3.3 Volt FTDI cable which is necessary to talk to the ESP8266 so that made flashing and changing baud rates and set up a lot easier.
 

rmeldo

Senior Member
Bottery power possible?

Hi,

I would like to ask the forum whether the 8266 is at all suitable for standalone battery (3AA batteries) powered applications, in view of its high power consumption.
I can see a one way communication, say, every few hours, where the unit is powered, data sent, and then shutdown again. However it wouldn't be possible to have the 8266 on standby to receive signals.

Is this right or am I missing a trick?

Many Thanks
Riccardo
 

john2051

New Member
Hi, one of the things I noticed with the modules I have is that the peak current is relatively high. On some dev boards for these they have quite high value
bulk capacitors. I'm not quite sure how this would affect battery life though.
john
 
Top