[Ovmsdev] Simple TCP client

Mark Webb-Johnson mark at webb-johnson.net
Sun Aug 23 22:37:46 HKT 2020


What are you trying to do?

From a design point of view, it seems strange to have an outgoing tcp connection from a vehicle module. Those modules need to be very responsive and realtime.

Mongoose is the correct approach. But take care, because most of the work is done in the network (not vehicle) task, so you need to deal with mutex and other concurrency issues.

Regards, Mark

> On 23 Aug 2020, at 7:54 PM, Soko <ovms at soko.cc> wrote:
> 
> Hey everyone,
> 
> I'm trying to send a simple tcp msg to a remote tcp-server. I've looked into the FreeRTOS example (esp-idf\examples\protocols\sockets\tcp_client\) which works (kinda) but OVMS behaves weirdly when I do it like that.
> 
> Thomas pointed me to mongoose...
> 
> So is this the way to go? I would take canlog_tcpclient.cpp as a model...
> 
> Ohh... and is it OK if I send my tcp msg in the vehcile task? Mongoose should take care of unforeseen errors so the task shouldn't block, right?
> 
> thx
> 
> Soko
> 
> 
> _______________________________________________
> OvmsDev mailing list
> OvmsDev at lists.openvehicles.com
> http://lists.openvehicles.com/mailman/listinfo/ovmsdev




More information about the OvmsDev mailing list