Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By schufti
#37862 regarding disable WiFi:
there are 2 stages:

a) WiFi.mode(WIFI_OFF);
if you intend to use WiFi in your sketch every now and then
this disables the intermittent delays due to WiFi but leaves WiFi-modem powered on

b) use API to set "RF_DISABLED";
this disables WiFi-modem and massively reduces power but needs a reset to apply, implemented e.g. ESP.deepSleep(0, RF_DISABLED); with all the other things needed for deeplseep.

Reenabling WiFi needs same procedure; so sporadic use of WiFi isn't easily implemented
User avatar
By Electroguard
#37881 Thanks guys, these were the sorts of things I've wanted to hear.
I'm trying to check out the feasibility of avoiding the memory and resource limitiations of any single processor, by adding additional processors and resources as required. Technically it would be 'cluster processing', but achieved with deceptive simplicity using variable length strings for communications between cluster nodes over any multi-node topology such as RS485.

Imagine the scenario which requires multiple functionality such as IR transmit/receive, interupt driven multi-IO, SD file access, speech output etc - all of which is readily achievable on Arduino, but not all at the same time... so why not just add any required functionality when needed by adding mores nodes dedicated to that functionality.

At first glance it may seem like a communications nightmare, but I don't think it actually needs to be. Put different tradesmen of different nationalities into a workplace together and they don't need to understand and converse with each other, they only need to understand their relevent job instructions and ignore everything else.
Different tradesmen who need to coordinate simply need to know some common command instructions appropriate for their coordination.
New trade functionality could be easily added using the minimum command words necessary for the job, so for instance a new tea lady would only need to understand the common commands for tea and coffee along with any optional parameters like milk and sugar, to which she alone would respond to.

In this way, a cluster could be built up to include whatever functionality is needed. And it could easily be added to, ie: integrating a 'voice recognition' processor to the cluster would just be a matter of making it broadcast any appropriate IR and wifi action commands etc which those corresponding existing processors would probably already be looking out to respond to anyway from other nodes. And adding new sensors and triggers from new processors would just be a matter of including the appropriate new commands to be recognised into any required receiving nodes list of recognisable commands to parse through.

By communicating using variable length strings, any commands and parameter data structures could be broadcast to all, even though only recognised by some.
Receiving nodes could use a circular buffer so they could parse for and extract any recognised plain text commands in their own time... allowing the tea lady to finish serving or making a fresh pot without distraction, then shuffle on to serve the next.

Any of the processors could access any of the clusters resources simply by issuing an appropriate string command, and resources could similarly respond with any required data.

Returning to the cluster scenario, any triggered input from (say) IO, PIRs, wifi nodes, IR signals etc, could request an appropriate list of plain text responses from config file on SD, then broadcast those listed action commands to other relevent nodes for speech announcements, IR transmits, relay switching, etc.

It all seems such practical common-sense that I'm sure it must already have been done, but I haven't seen anything like it yet, so I'm a bit concerned I may be chasing a wild goose up a blind alley, and therefore would appreciate the thoughts of others regarding the feasibility.
User avatar
By mrburnette
#38466
<...>
And adding new sensors and triggers from new processors would just be a matter of including the appropriate new commands to be recognised into any required receiving nodes list of recognisable commands to parse through.

By communicating using variable length strings, any commands and parameter data structures could be broadcast to all, even though only recognised by some.


So many architectural ways to approach, but you need to do some serious homework... with uC's the community typically uses RTOS to manage such thingsL in fact, the ESP8266 under ArduinoIDE has a thread dedicated to each repetition of loop(), delay(0), or yield(). However, one could still use an RTOS on a fast, inexpensive, Arduino compatible board such as the STM32duino.

I'm a big proponent of multicontrollers when it makes sense. Two of my old AVR projects off-load the SD-Card logging and the IR receiving to dedicated uC's:
http://www.hackster.io/rayburne/infrared-dedicated-decoder
http://www.hackster.io/rayburne/sd-card-serial-logger

Now, you may also find this article of mine: http://forum.arduino.cc/index.php?topic=147550.0 interesting due to the simple parser. Commands are blocked to 3-characters and are arbitrary: one can read or set the state of a digital pin or read an Analog port. Original article http://www.instructables.com/id/Arduino-Scientific-Calculator/?ALLSTEPS

Good luck, other than simple off-loading, my gut tells me it is usually easier to get a more capable computer!

Ray
User avatar
By WereCatf
#38469
schufti wrote:b) use API to set "RF_DISABLED";
this disables WiFi-modem and massively reduces power but needs a reset to apply, implemented e.g. ESP.deepSleep(0, RF_DISABLED); with all the other things needed for deeplseep.

Reenabling WiFi needs same procedure; so sporadic use of WiFi isn't easily implemented


Actually, you can apparently put the modem to sleep with WiFi.forceSleepBegin() and wake the modem up with WiFi.forceSleepWake() now, just remember to stop all HTTP-servers and whatnot you have running before putting the modem to sleep and not calling any network-related stuff while it is asleep and you should be all set.