Softata: Architecture
softata rpipico firmata arduino csharp bme280 grove pico sdk-for-c-arduino tcpip
Various devices are connected to a RPi Pico W via a Grove RPi Pico Shield. This provides simplicity and some surety with the connectivity. The Pico runs as an Arduino device, making available a vast range of devices through Arduino libraries. The device code is not written from the ground up using low level connectivity code, but makes direct use of existing code for devices available through the Arduino library or downloadable from various vendors as zip files.
The Pico W, the wireless version, is required as the app runs as a WiFi service. Clients can connect to it and send messages and await responses. The sent messages contain information about the target device, the device type, the command and related data. Each call from the client expects the returned data , a byte array, when converted to a string, to contain an expected string, such as “OK:”. This is used as simple validation of the exchange between the client and the server. The returned string will also include data if the request was a read, status or information request.
The Arduino app implements a watchdog timer that is enabled with a configurable period of 10 seconds. The Arduino loop() touches it every loop as does any wait while
loop delays. This means that if the code is errant the app will reset. It could also be modified such that the touching of the watchdog timer is done whenever a command is received over the server or if the .NET end is idle, it sends periodic messages to the server. This would require that the watchdog timer is only started upon teh app receiving its first command and to be able to be stopped or put in a null mode by a specific command.
Topic | Subtopic | |
This Category Links | ||
Category: | Softata Index: | Softata |
Next: > | Softata | Service Commands - 1 |
< Prev: | Soft-ata | A Simple Firmata with .NET |