pátek 30. ledna 2015

NTP over ESP8266

I spent about two hours trying to figure out how to do that, but looks like my ignorance when it comes to AT commands used by ESP, and the ignorance when it comes to the SNTP protocol is simply deadly. All I got was a few random characters, similar to other people trying to do the same. I don't feel like reading the corresponding RFC right now, so let's play WoT and listen to good old Prodigy.

Arduino based RF24 sensor node

This is a long term experiment to measure how long an average battery lasts when powering a simple sensor node. The node is based on 328p and RF24. The power consumption while sleeping is 20uA, while it draws something over 10mA when communicating. It's more or less of what I expected. The node wakes up every 8 second and sends a short packet.
I just measured the battery voltage, and found out it has dropped to 3.2V, which is way too low for the LiIon. I had to cancel the experiment after about two weeks. Anyway, it proved that this might work, and the battery, or a CR2032 coin cell can be used for powering such a node. The real one will wake up once per five minutes or so, thus I expect the battery life to be much more.
The code can be found in SVN:
RF24Sensor code
It doesn't use the RF24Network library yet, and there's also the EEPROM support missing. I was modifying the code in the meantime, and it sort of matured into something bigger:
RF24Node code

Arduino Pro Mini problems, and finally working ESP8266 firmware and Arduino library

The Arduino Pro Mini kits I received recently from China aren't quite okay. I had some strange troubles with them, and I am not quite sure what was the reason. Yeah, I managed to connect the programming cable backwards to one of them, and the Arduino started misbehaving. Uploads did not finish unless I disconnected power and yanked the USB/UART adapter and so on... On a second kit, I actually noticed I've used wrong COM port, which would explain the connection timeouts :)
Anyway, I reflashed all three of them with the bootloader from Arduino 1.0.5 and they seem to work fine so far. The fourth one has already a new bootloader as it was modded for 8MHz lowe power operation (crystal implant and LED and LDO removal).
I spent the rest of the evening looking for the right version of ESP8266 firmware, and working Arduino library. So far, I'll stick with 0.9.2.4 I found under name v0.9.2.4 AT Firmware-ESPFIX.bin
As for the library - after a lot of experiments, it looks like Lady Ada got it right again. Her library works as expected (so far), uses SoftSerial to communicate with ESP8266 (necessary when you use Arduino with just one HW serial port), and compiles at first try! Thanks, that was what I needed:
Adafruit ESP8266 library
Enough of HW stuff, going to play WoT...