Example or library which covers some of standard concepts in between two permanently connected devices

djixon
Posts: 113
Joined: Sun Oct 01, 2023 7:48 pm

Example or library which covers some of standard concepts in between two permanently connected devices

Postby djixon » Fri Nov 10, 2023 12:35 pm

Suppose two ESP chips are connected (over WIFI or BT). Both have predetermined SSID and Passwords at compile time. One device is powered as Access Point (master) while second (which connects to AP) is a slave. Once they establish connection, they stay permanently connected until power is down.

Is there a library (or some example) which would provide wireless-uart over such connection?
Or, even better, is there a library or example which would provide wireless-memoryshared blocks among those two devices which refresh on some predetermined interval?
For example, both devices devA and devB have two memory regions regR and regW. RegR is a read only and represents a copy of regW block from other device and regW is write only and represents block which has to be sent to other device on next time interval.

Doesn't matter if WIFI or BT is chosen, they should provide only "carrier like" behavior, even doing automatic encryption of data "in the air" but that should be completely automatic and completely transparent for top-level component like Memory_Shared_Regions. For example, when you install a driver of such component you pass some structure like

volatile struct Mem_Shared_config {
pchar* SSID;
pchar* password;
DevType {access point or Slave);
uint8_t* SendingBuffer;
uint8_t* ReceivingBuffer;
bool doEncryption;
uint32_t TimeIntervalForExchange;
bool ExclusiveConnection;
}

... and such a driver provides all necessary configurations, esstablishing connection on power up, and providing those block exchanges
on each time interval, assuming that wifi/bt will not be used for any other device connection if exclusive connection is true etc.

Any similar example?

MicroController
Posts: 1708
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: Example or library which covers some of standard concepts in between two permanently connected devices

Postby MicroController » Fri Nov 10, 2023 5:20 pm

Usually people use send(socket,...) to write a copy of some local memory to another device's local memory, and recv(socket,...) to duplicate a piece of remote memory to local; see e.g. https://github.com/espressif/esp-idf/tr ... ls/sockets

djixon
Posts: 113
Joined: Sun Oct 01, 2023 7:48 pm

Re: Example or library which covers some of standard concepts in between two permanently connected devices

Postby djixon » Sun Nov 12, 2023 10:23 am

Thx for the advice. I adapted it to my needs and made it usable in my app.

Who is online

Users browsing this forum: No registered users and 111 guests