WiFi and the Raspberry Pi


The ESP8266 is a fabulous new inexpensive device to prototype IoT devices. It works well with the NodeMCU firmware and the Arduino IDE, but the AT command firmware is not very reliable. I'm off now to start programming the smart WiFi interface for SunRover.

Coming Next Time

The next SwitchDoc Labs column will be exciting for solar power fans. I will set up and execute a test of how much additional solar power you can get by tracking the sun on your solar-powered Pi or Arduino projects.

I am running two computers side by side on solar panels, with one tracking the sun and the other facing due south. It should be interesting to find out the exact practical numbers. At this point, I intend to use two ESP8266 devices to run each of the solar power stations.

SwitchDoc Note

The instructions here are for the Adafruit Huzzah ESP8266 boards. If you are going to use a different breakout board or module, you need to pay attention to what voltages you connect to the GPIO pins and the ESP8266, and what voltage your FTDI cable supplies. You will fry your ESP8266 and maybe damage your Raspberry Pi or Arduino. Check before you plug the FTDI cable to the Raspberry Pi USB port.

Q & A

[UCC:interviewer]Q:[/UCC] I recently purchased SunAirPlus [17] Solar Power Controller for my home autonomous solar-powered webcam project. I connected a single 18650 3.7V LiPo battery to the battery input of the board and two 12V solar panels connected in parallel with safety diodes stepped down to 5V to the solar panel input. I connected the load output of the board to my Raspberry Pi.

I left it running overnight expecting in the morning having sun on my batteries to see that LiPo is charging and RPi is working again (in case LiPo died overnight). But I see on the USB meter that, even with bright Australian sun, the board draws only 90mA and barely can charge the LiPo. I noticed that SunAirPlus draws very discrete 90mA or 110mA, no more no less.

So, I don't understand what I'm missing here … why the board draws just 90mA. My suspicion is maybe it expects not 5V input from solar but 6V? Levon – Australia

[UCC:interviewee]A:[/UCC] You need more than 5V to get SunAirPlus to charge at the full rate. The whole charge controller is designed for 6V solar cells. Modifying your circuit to go to 6V instead of 5V will fix the problem. Check it out beforehand with a variable power supply, and you can absolutely see the dynamics of the system.

When designing a new project, I always use a variable power supply in place of the solar cells to test the system.

Listing 6 shows some current results from SunRover. SAP0 is the SunAirPlus charging the motor batteries. The batteries are close to being fully charged (I have 24,000mAh for the motors – a bit of overkill). The 5V power supply of the SunAirPlus board is currently not driving a load, but SAP1 is driving a Raspberry Pi 2 and is fully charged.

Listing 6

Results from SunRover

LIPO_Battery Bus Voltage: 4.21 V
LIPO_Battery Load Voltage: 4.19 V
LIPO_Battery Current: -200.40 mA
Solar Cell Bus Voltage: 5.66 V
Solar Cell Load Voltage: 5.64 V
Solar Cell Current: 201.20 mA
Output Bus Bus Voltage: 4.98 V
Output Bus Load Voltage: 4.98 V
Output Bus Current: 1.60 mA
LIPO_Battery Bus Voltage: 4.19 V
LIPO_Battery Load Voltage: 4.19 V
LIPO_Battery Current: -4.00 mA
Solar Cell Bus Voltage: 5.54 V
Solar Cell Load Voltage: 5.50 V
Solar Cell Current: 462.40 mA
Output Bus Bus Voltage: 4.90 V
Output Bus Load Voltage: 4.94 V
Output Bus Current: 365.20 mA


  1. Espressif: http://espressif.com
  2. "iBeacons" by John Shovic, Raspberry Pi Geek, issue 06, pg. 76: http://www.raspberry-pi-geek.com/Archive/2014/06/BeaconAir-Track-your-Pi
  3. ESP8266: https://room-15.github.io/blog/2015/03/26/esp8266-at-command-reference/
  4. AT commands: http://www.pridopia.co.uk/pi-doc/ESP8266ATCommandsSet.pdf
  5. Drivers for Huzzah: https://drive.google.com/folderview?id=0B_ctPy0pJuW6d1FqM1lvSkJmNU0&usp=sharing&tid=0B3dUKfqzZnlwRXhBTmlhaTROTmM
  6. Esptool.py: https://github.com/themadinventor/esptool
  7. Minicom: http://www.hobbytronics.co.uk/raspberry-pi-serial-port
  8. Web server code: https://github.com/guyz/pyesp8266
  9. Flash NodeMCU: http://www.whatimade.today/flashing-the-nodemcu-firmware-on-the-esp8266-linux-guide
  10. Adafruit tutorial: https://learn.adafruit.com/building-and-running-micropython-on-the-esp8266/flash-firmware
  11. NodeMCU: https://github.com/nodemcu/nodemcu-firmware/releases
  12. luatool.py: https://github.com/4refr0nt/luatool
  13. Adafruit Huzzah ESP8266 tutorial: https://learn.adafruit.com/adafruit-huzzah-esp8266-breakout/using-arduino-ide
  14. Single threading: https://en.wikipedia.org/wiki/Single_threading
  15. PlatformIO: http://docs.platformio.org/en/latest/platforms/espressif.html
  16. "SunRover " by John Shovic, Raspberry Pi Geek, issue 13, pg. 68: http://www.raspberry-pi-geek.com/Archive/2015/13/SunRover-part-1-Track-motor-controller-power-system
  17. "Solar Power Management" by John Shovic, Raspberry Pi Geek, issue 10, pg. 32: http://www.raspberry-pi-geek.com/Archive/2015/10/Managing-solar-power-systems-with-SunAir-boards

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Raspberry Pi Geek

Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content