Send data via websocket from ESP32 to server?
Posted: Wed Dec 19, 2018 6:25 pm
Hi all,
I'm trying to send sensor measurement data from an ESP32 to a raspberry based server.
A test setup running on another computer with the complete python3 environment works like a charm. The minimal working example under python3 looks like this:
import websocket
ws = websocket.WebSocket()
ws.connect("ws://192.168.0.5:3000")
ws.send( data ... )
I like to achieve the same on the ESP32.
As part of the MicroPython installation on the ESP32 I found the "websocket" module. When I import the websocket module and try to run my example code it tells me that the module websocket has no attribute "WebSocket". So to me it seems that the websocket module in MicroPython is fairly limited.
Does someone have an idea what is the best way to feed data via websockets from the ESP32 to another server and might give me a hint?
I'm trying to send sensor measurement data from an ESP32 to a raspberry based server.
A test setup running on another computer with the complete python3 environment works like a charm. The minimal working example under python3 looks like this:
import websocket
ws = websocket.WebSocket()
ws.connect("ws://192.168.0.5:3000")
ws.send( data ... )
I like to achieve the same on the ESP32.
As part of the MicroPython installation on the ESP32 I found the "websocket" module. When I import the websocket module and try to run my example code it tells me that the module websocket has no attribute "WebSocket". So to me it seems that the websocket module in MicroPython is fairly limited.
Does someone have an idea what is the best way to feed data via websockets from the ESP32 to another server and might give me a hint?