Wednesday, September 30, 2015

ESP8266 or Arduino

I started off thinking of adding one of these to my ArduinoRainStation. So I started looking into writing some Arduino code to use the AT commands in the of the shelf firmware.This was going ok, apart from all of commands are required just to set the ESP8266 up and there is an overhead to send back and forth any data. Each data exchange you have to sit waiting for something like this,
+IPD,0,5: hello
which is 5 bytes of data on port 0.
then to send hello back,
AT+CIPSEND=0,5
then wait for '>' and send 'hello'
then you can go back waiting for +IPD again
and to make it a little more complicated you sometimes get,
+IPD,0,5: hello
+IPD,0,2: \r\n

Depending on which telnet client your using. The stuff that browsers spit out is much more irregular.
Also can be very big bigger than the serial buffer in a little Arduino.

At this point I started to look at native code.

There are a number routes from native SDKs to scripting in LUA. Both had a learning curve for myself. After a bit of a Google  I found something a little more in fitting with the rest of my project. esp8266 with Arduino IDE and it is just like it.

I'm not going to go into the ins and outs of installing and setting up as there are plenty of blog post. The github README.md was good enough for me to install on windows10 and Ubuntu. What I want to show how simple it is to get a simple WIFI device going. See the code at esp-AP.ino which is a copy from the library examples, WiFiAccessPoint.ino tweaked to my needs.

Like with all Arduino code there is a void setup() and void loop(). The void loop()  runs a server.handleClient(); which calls a handleRoot()  call back function when it gets a HTTP connection. This leaves me free to deal with what I want to send as my messages. No long streams of AT commands.

Next steps are:
  1. To write code to fetch sensor data from an Arduino and send to browser.
  2. Read the browser request maybe switch Led on?

Thursday, May 21, 2015

unexpected 3v3 regulator


Finally worked out how to run my ESP8266 Wifi board from my cheep USB serial adaptor.
Set up for 115200 baud and nothing.
if you send
AT+RST

you will get a response of,

ets Jan 8 2013,rst cause:4, boot mode:(3,6)
wdt reset
load 0x40100000, len 24444, room 16
tail 12
chksum 0xe0
ho 0 tail 12 room 4
load 0x3ffe8000, len 3168, room 12
tail 4
chksum 0x93
load 0x3ffe8c60, len 4956, room 4
tail 8
chksum 0xbd
csum 0xbd
ready

and


If you tried this from the adaptor 3v3 you would get garbage. Looking at 3v3 on scope it was horrible.
Only to be expected as it turned out to be a zener diode and data sheet said the ESP8266 can take over 200mA.
Look at https://nurdspace.nl/ESP8266 for more info.
 
 

Tuesday, February 17, 2015

Jtag looks simple?

found these:
and got openocd.sourceforge.net/ to program http://www.stm32circle.com/resources/stm32primer.php it has a RLINK adapter built in.
but I feel I'm missing something.

this was some help www.robofun.ro/docs/Manual_PROGRAMMER.pdf.
but not sure why elf files will program but not bin.
thought elf was re-locatable to do with OS?

and what about these Bootloaders. 

Wednesday, January 7, 2015

Looking at ARMs again.

http://embeddednewbie.blogspot.co.uk/2011/01/free-toolchains-for-stm32vldiscovery.html
Arduino's are great but I'm hankering after something with more grunt.
And I really need to find out about this JTAG stuff.