This is a NodeMCU (ESP-WROOM-32) based ADC data logger.
Install PlatformIO in Visual Studio code, hit compile and upload.
Upload via USB cable or use the OTA mechanism. For this the computer must be connected to the ESP somehow via Wifi (AP or STA mode).
Add this for the OTA update mode in the platformio.ini
upload_protocol = espota
upload_port = 192.168.1.66
upload_flags =
--port=3232
# write config
curl -X POST 192.168.1.66/channel/1/config\
-H "Content-Type: application/json" \
-d '{"samplingInterval":1,"bufferSize":1,"samplingEnabled":true,"offset":0.194,"factor":82.0,"divisor":1.0, "fl":80}'
# read config
curl -X GET 192.168.1.66/channel/1/config | jq
# write wifi config to connect to WIFI
curl -X POST http://192.168.4.1/wifi -H "Content-Type: application/json" -d '{"mode":"sta","ssid":"myWIFI","pass":"mypassword"}'
# write wifi config to make a custom WIFI
curl -X POST http://192.168.4.1/wifi -H "Content-Type: application/json" -d '{"mode":"ap"}'
# Read wifi config
curl http://192.168.4.1/wifi | jq
curl -s -X GET 192.168.1.66/channel/1 | jq
{
"data": [
{
"timestamp": 184537436,
"value": 84.57603
}
],
"overflow": true
}
$ mosquitto_sub -h 192.168.1.66 -t 'channel/1' -v
channel/1 {84.4439}
channel/1 {84.5100}
channel/1 {84.5100}
channel/1 {84.5100}
See client/ for a golang demo accessing the measurement channels via websocket in golang
$ go run main.go -host 192.168.1.66
0, 0, 0.000000
1, 184795439, 84.443909
1, 184796439, 84.443909
1, 184797439, 84.509972
1, 184798439, 84.377838
1, 184799439, 84.245697