OpenEVSE and Raspberry Pi

1,722 views
Skip to first unread message

Chris

unread,
Jun 30, 2013, 5:59:07 PM6/30/13
to open...@googlegroups.com
A few weeks ago I added wireless to OpenEVSE and realized the solution was limited and expensive. I have had a raspberry pi for a while now and finally got around to playing...

This is not intended to be a tutorial or a step by step guide. Once I get it all figured out I will post one. For now, I am using USB adapters for IO. It is possible to us the Pi's GPIO but level shifting from 5v to 3.3v is required. So until I get a chance to design a board I will just use the USB devices.

Hardware:
Raspberry Pi
SD card
USB to serial adapter
USB AVR asp

PC:
SSH client (I like PuTTY)


Set up SDCard with Raspberrian (or buy card pre-loaded from Adafruit)

Connect pi to KB, Mouse, display for basic config

Configure basic settings
Make sure to enable SSH

Find IP address - note address

ifconfig

Connect to Pi with SSH (KB, Mouse and display no longer needed)

Install AVRDude (to upload Firmware)
sudo apt-get install avrdude

Install Screen (to communicate with OpenEVSE over serial)
sudo apt-get install screen

Grab firmware from web and save it locally (Serial CLI is enabled)

Upload firmware to OpenEVSE 
sudo avrdude -c usbasp -p m328p -U flash:w:/var/www/openevse.hex

Connect to OpenEVSE via serial 
screen /dev/ttyUSB0 38400

hit enter and you should get the Open_EVSE> prompt.
type show.

to exit CTRL - a, then k

You now have complete remote control of OpenEVSE over SSH 


Chris

unread,
Jun 30, 2013, 6:06:00 PM6/30/13
to open...@googlegroups.com
Next I added a webserver based on this tutorial http://www.raspberrypi-spy.co.uk/2013/06/how-to-setup-a-web-server-on-your-raspberry-pi/

Basic steps:

sudo apt-get -y install lighttpd

sudo apt-get -y install php5-common php5-cgi php5

sudo lighty-enable-mod fastcgi-php

sudo service lighttpd force-reload

sudo ip addr show

Test out web services by opening ipaddress in a web browser.

sudo chown www-data:www-data /var/www

sudo chmod 775 /var/www

sudo usermod -a -G www-data pi

sudo reboot



So next steps are to start pushing/pulling info from OpenEVSE over serial. I am planning to use PYTHON and pyserial on the pi to communicate with the OpenEVSE board and generate webpages. I am also planning to get data from the vehicle using the Tesla REST API python script and from the LEAF with a CAN device....

Chris

unread,
Jun 30, 2013, 7:25:04 PM6/30/13
to open...@googlegroups.com

for remote control using windows remote desktop install xrtp...

 sudo apt-get install xrdp

Run Remote Desktop Connection from windows using IP address of Pi

Frédéric RICHARD

unread,
Jul 8, 2013, 3:32:14 AM7/8/13
to open...@googlegroups.com
Hi,

I think, I will try to add an Raspberry Pi to my Open ESVE, so, I have a couple of  questions.

#1 : How do You power the Raspberry? Do You use an external AC to mini USB converter?

#2 : I brought an adafruit USBtinyISP Kit, may I use it as 'USB AVR asp'?

#3 : If I understand, You use an USB to serial adapter because of 5.5v to 3.3v conversion. So, You plug the GPIO to USB. May I use an old USB cable od do I have to buy an specific adapter ?

Thanks,

Regards.

Fred

Chris

unread,
Jul 11, 2013, 5:16:12 PM7/11/13
to open...@googlegroups.com
I powered the pi with a AC to USB plug.

The adafruit ISP will work fine just change the programmer type in the avrdude command.

Yes the USB adapters are to get around the voltage difference, just plug both USB adapters into the pi and the connectors to the OpenEVSE board.

Frédéric RICHARD

unread,
Aug 7, 2013, 4:12:49 AM8/7/13
to open...@googlegroups.com
Hi,

I received all the parts and i'm begging to make all work together.

I Ordered an RN-VX WiFly and a Xbee explorer.

Could You help me to use this RN-VX with raspberry ?
I would like to use the RN-VX like an WiFi dongle.

RN-VX is associated with my WiFi Lan, i can Telnet with no problem

This is how i plugged all together

Rapsbery PI GPIO -> Xbee
#1 (3.3v) to #3 (VCC)
#6 (GND) to #2
#8 (TXD) to #5 (RXI)
#10 (RXD) to #4 (TXO)

I changed boot option to free UART serial.

Yet, if i type in terminal: echo toto > /dev/ttyAMA0
I see D2 of RN-VX blinking.

But, I cant SSH using RN-VX IP, I get 'connexion refused'

Thank's for help.

Chris

unread,
Aug 8, 2013, 2:44:26 PM8/8/13
to open...@googlegroups.com

You probably just need to set the baud rate of the Pi UART to match the WiFly module.

 


 

Stelios Valavanis

unread,
Dec 7, 2014, 5:42:17 PM12/7/14
to open...@googlegroups.com
The last post here is old and I don't see this topic discussed in another post. Can anyone tell me the state of the raspberrypi OpenEVSE project? I'm about to buy a combo from the openEVSE store and would prefer to do this on a Pi as I believe a web server will open up many possibilities.

chris1howell .

unread,
Dec 7, 2014, 7:18:22 PM12/7/14
to open...@googlegroups.com
Connectivity to the pi is possible, you can SSH into the serial console with OpenEVSE firmware with SerialCLI enabled. It works good with the Serial TTL adapter from the store. Some coding would need to be done to use the new Remote API and a web server.

Lincomatic is hard at work on a node.js web server for the TP link 703 router. The same code may work on the Pi, but the TP link is up first.

On Sun, Dec 7, 2014 at 2:42 PM, Stelios Valavanis <stelva...@gmail.com> wrote:
The last post here is old and I don't see this topic discussed in another post. Can anyone tell me the state of the raspberrypi OpenEVSE project? I'm about to buy a combo from the openEVSE store and would prefer to do this on a Pi as I believe a web server will open up many possibilities.

--
You received this message because you are subscribed to the Google Groups "OpenEVSE" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openevse+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

bo...@pnnl.gov

unread,
May 18, 2015, 6:49:09 PM5/18/15
to open...@googlegroups.com
Hi Chris

Newcomer to the forum and OpenEVSE work. 

We have been working on a control systems platform (open-source) called VOLTTRON. We are planning on integrating VOLTTRON with an EVSE. 
VOLTTRON already runs on raspberry Pi and other small form factor devices. URL is http://volttron.org

I was wondering if there was more progress on the raspberry pi interface. 

We are looking to add support for OpenEVSE inside VOLTTRON via either serial link or an Ethernet interface.

VOLTTRON is designed to act as a control hub for different types of devices (e.g HVAC, storage, etc).

Please contact me via email if you would like to discuss further.

Regards

Bora

Nick Sayer

unread,
May 19, 2015, 12:57:02 PM5/19/15
to open...@googlegroups.com
There isn't really much further progress required to interface the two.

Both OpenEVSE and OpenEVSE II have standard 5 volt FTDI connectors. They can be easily interfaced with the Raspberry Pi by connecting ground to ground, the FTDI Rx pin to GPIO 14 (pin 8. No level shifting required going in the output direction) and connecting the FTDI Tx pin to GPIO 15 (pin 10) through a simple diode+pull-up level shifter. To make the level shifter, connect the cathode of a 1N4148 diode to the Tx pin and connect the anode to GPIO 15. Then, add a 10k resistor between the anode and 3.3 volts.

Having done that, and compiled the OpenEVSE firmware with RAPI, you can command it with serial commands on the Raspberry Pi serial port.

Craig Kirkpatrick

unread,
May 19, 2015, 1:52:36 PM5/19/15
to open...@googlegroups.com
Maybe it sounds overkill, but I'll bet a USB-FTDI cable can just connect the Pi with OpenEVSE's FTDI port.  The cleanest approach is embedding some inexpensive WiFi adapter to FTDI in the polycarbonate enclosure such as the Gl.iNet pocket router.  Also Bluetooth LE is a possibility being explored by Andre with some success.  I'll try a variation of an ESP8266 WiFi module in a few weeks and if I can get that working then it is dirt cheap at <$10.

Chris and I have been in contact with Bora and I may pay folks at PNNL a visit on Wednesday next week since I'm already there for another appointment next week.  PNNL is one of the US National labs located in Richland Washington.

Danny ter Haar

unread,
May 19, 2015, 2:03:29 PM5/19/15
to open...@googlegroups.com


On Tuesday, May 19, 2015 at 10:52:36 AM UTC-7, Craig Kirkpatrick wrote:
 
I'll try a variation of an ESP8266 WiFi module in a few weeks and if I can get that working then it is dirt cheap at <$10.
 
What version will you be using ?

All the ESP8266 i've seen  so far are 3.3V and would be killed instantly when you connect them to the openevse.

I ordered a few and a few power converters: http://www.ebay.com/itm/281667714648


Craig Kirkpatrick

unread,
May 19, 2015, 2:12:45 PM5/19/15
to open...@googlegroups.com
I like this one:  https://www.adafruit.com/product/2471
The only problem is it must be super popular and it is out of stock at Adafruit.  I have a Product Notification set with Adafruit where they will email me when they are back in stock.  



b

Nick Sayer

unread,
May 19, 2015, 2:17:27 PM5/19/15
to open...@googlegroups.com
It’s not *too* hard to make a 3.3v FTDI adapter gizmo. It would be a board with two SIP-6 headers on it. There would be just a single level-shifter made with a diode and resistor on the 5v->3v Tx line, and a 3.3V LDO to convert Vcc from 5 to 3.3 volts.
> --
> You received this message because you are subscribed to a topic in the Google Groups "OpenEVSE" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/openevse/MSG8GBmU2wI/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to openevse+u...@googlegroups.com.

Rumen

unread,
Nov 4, 2015, 9:18:36 AM11/4/15
to OpenEVSE
Hi Nick,

I am newbie in electronics so forgive me if I ask silly questions. Would you please advise why do you recommend diode instead resistor like in this guide:
http://blog.oscarliang.net/raspberry-pi-and-arduino-connected-serial-gpio/
and if I use diode should it be connected like that:
- diode's cathode to Ground, diode's anode to Rx of the Rasp(GPIO 15)
- 10k resistor between the anode and Tx of OpenEVSE

Thanks,
Rumen

Nick Sayer

unread,
Nov 4, 2015, 10:22:51 AM11/4/15
to open...@googlegroups.com
Their method works as well, but you need to select the resistor values properly to insure the voltage winds up correct.  

The diode+pull-up technique is a little less fiddly.  

The cathode of the diode should connect to the logic source (the output), and the anode to the logic sink (the input). A resistor should be connected from the anode to the input logic chip's Vcc. When the signal is high, the diode will block it and the pull-up resistor will pull it high. When the signal is low, the diode will be forward biased and the pull-up will be overridden. 

The pull-up resistor should be chosen to balance the speed required with the amount of current it will draw when the signal is low. 1-10k is the usual range. 

Sent from my iPhone

Sébastien Maccagnoni-Munch

unread,
Nov 4, 2015, 10:26:34 AM11/4/15
to open...@googlegroups.com
I am successfully using two resistors, 220 ohms (in place of their 1,6kohm) and 330 ohm (in place of their 3,3 kohm).

--
You received this message because you are subscribed to the Google Groups "OpenEVSE" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openevse+u...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Nick Sayer

unread,
Nov 4, 2015, 10:32:46 AM11/4/15
to open...@googlegroups.com
You're pulling 10 mA from the Arduino pin when it's high instead of 1 mA. That's a bit much. 

Sent from my iPhone
Reply all
Reply to author
Forward
0 new messages