-
Notifications
You must be signed in to change notification settings - Fork 1
Software Installation
This is basically taken from micropython documentation
Setup webrepl on the esp via serial connection, (my serial port is /dev/cu.usbserial
, change it to whatever device you are using)
screen /dev/cu.usbserial 115200
Now enable/set up webREPL:
import webrepl_setup
Enable the demon and provide a password.
In order to copy files over wifi you need to clone https://github.com/micropython/webrepl
Edit cp_esp.sh
according to your serial port and the password you provided.
Replug/reset the ESP.
Once the system is flashed with micropython and restarted the socket will show up as an wireless access point with the name MicroPython-AABBCC
(AABBCC are the last 6 digits of its MAC address). The default password for the WiFi is micropythoN
(capital 'N').
Create folders for css files and the obi_socket python package:
import os
os.mkdir('static')
os.mkdir('obi_socket')
Now you can either use the webREPL page, rshell or ./cp_esp.sh
(uses webrepl_cli) to transfer the python files to the ESP.
Don't forget to copy the .css file into the static
folder on the ESP as well.
Copy python code:
./cp_esp.sh boot.py main.py
./cp_esp.sh obi_socket/*
Copy css file to ESP via webrepl_cli:
./cp_esp.sh static/mini-default.min.css
Restart the device and the web-app should start.
Now the socket opens up an access point for initial configuration with the name "obi-socket-AABBDD". Connect to it with the password "myobiPassword". You can change the default password in config.py
. Its IP address will be 192.168.4.1 once you connect to its network.
Browse to http://192.168.4.1/setup and enter the wifi client wifi_ssid
, wifi_pw
and restart the device.
Once the the socket reboots it will flash the green LED while trying to connect (timeout is about 10 seconds). If the wifi client connection succeeds, the green LED will light up continuously and access-point mode is stopped.
Depending on your dhcp server setup the socket can now be addressed at http://obi-socket-xxyyzz (or whatever hostname you provided during setup).
To reset/delete the wifi config press the ON/OFF button for about 10 seconds until the red LED starts flashing and the socket will reboot to setup-mode (access-point available).