ESP8266 project which is meant to be used in a EV charging use case. Uses O-DF/O-MI protocols for control.
*Wemos d1 mini
*Ai thinker A7 GPRS/GSM
*Sonoff POW
*leds for indication
*Pin lock
Arduino with esp8266 core for building and uploading programs to hardware.
Some http server for serving the user interface in UserHtml
directory on the
same server as an O-MI node server. I used
nginx with this kind of
configuration.
- Copy the configuration file to /etc/nginx/
- put
include /etc/nginx_reservations.conf;
in /etc/nginx.conf
O-MI node server with agent for handling the reservations. This link has it preinstalled.
-
Run by starting
bin/o-mi-node.sh
-
The device needs a network connection to this server
- Static IP or DNS address is required
- Ports need to be open to internet if the server is not used in the same network
-
I have test server running at http://biotope.cs.hut.fi/omi/node/ but it might require newer version from branch
master
of this repository.
1.5V Wemos d1 mini <-->EXTERNAL 5V SUPPLY<-->Ai thinker GSM/GPRS VCC
2.GND Wemos d1 mini<--> GND<-->Ai thinker GSM/GPRS GND<-->SONOFF POW GND PIN(!!!!They must be connected same gnd ,otherwise serial communication does not work properly.)
3.Wemos d1 mini(D3) <--> Ai thinker GSM/GPRS PWR
4.Wemos d1 mini (D8) <--> Ai thinker GSM/GPRS RX
5.Wemos d1 mini(D7) <--> Ai thinker GSM/GPRS TX
6.Wemos d1 mini (D1)<--> LOCK TRIGGER pin
7.Wemos d1 mini (D5)<-->SONOFF POW TX pin
8.Wemos d1 mini(D6)<-->SONOFF POW RX pin
9.Wemos d1 mini(RX)<-->Between sonoff and wemos communication check led(IT FLASHES EVERY 8 SEC)
10.Wemos d1 mini (D0)<-->Upload indicator led
11.Wemos d1 mini (D2)<-->Connection indicator led
12.Wemos d1 mini(TX) <--> Wemos d1 mini(D4) (For serial port monitoring features)
This project uses sonoff only for the relay electronics and packaging. It has also esp8266 chip which could be used for this project, but it doesn't have other than serial pins available easily. So for future expansion possibilities I chose to use another esp8266 for the real program. Anyways sonoff need to be reprogrammed, which is quite easy.
- Open
Son_off_pow/Telnet_debug/Telnet_debug.ino
in Arduino IDE - Change board to
Generic ESP8266 Module
- Open Sonoff module package to reveal the circuit board
- Solder a pin header to Sonoff holes marked as VCC, TX, RX, GND
- Connect USB to TTL adapter to the header (TX to RX, RX to TX, VCC to VCC, GND to GND)
- Before connecting USB to TTL adapter to USB, press down the button in Sonoff and keep it pressed while connecting the USB cable.
- Select right port from Arduino IDE
- Press Upload
This program only waits for "I" or "O" from serial and sets the relay to corresponding state.
You should modify Telnet_debug.ino
to use debug features and telnet congfiguration.
1.if you define TELNET_DEBUG
,you can monitor power,current,voltage,frequency as wireless.
2.To send with serial port,define SERIAL_COM
in software.
1.const char* ssid = "WifiSSID";
const char* password = "WifiPassword";
2.Get IP address with Serial.println(WiFi.localIP())
.
3.Enter IP address on Putty(Terminal Program). putty download:http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
- Connect USB cable to ESP8266 and computer.
- use Makefile with
make upload
- Change Settings for your Module (WeMos Mini for me)
- Upload
The server stores some reservations in a database. The user interface sends requests to the server to store information. The esp program listens the server for information.
TODO
- This repository for software for the hardware.
- Server Agent source file for O-MI Node server at here
- or as a complete package here