A place users can post their projects. If you have a small project and would like your own dedicated place to post and have others chat about it then this is your spot.

User avatar
By canta
#41743 gladly found this thread

I have been working to control local S20, have some when $15 each including freeshipping.

at now, I control with python, the link is on of your link about S20.
I do not care about scheduling since my back-end will control scheduling of each S20.

All working as I expected the only caveat is running my python S20 script in the background.

ESP8266 is an easy and cheap to control, with powerful mqtt client and back-end. this can be a master to check S20 status update and to know if S20 is dead or alive (responding udp broadcast).

esp8266 multiWiFi can be a good candidate. will see on how to make works.

espp8266 connects to router and acts as soft AP for S20 devices., and esp8266 will broadcast or respnose via mqtt topic/subscribe . At the same time, ESP8266 will control S20 that based on mqtt topic command from back-end.

my goal is put on heavy infrastructure on mqtt since easy to maintain when adding more devices in the future :D.
the back end must be implemented in AI and Machine learning.
current goal is to finish enough devices ~20 or 40 units. and start machine learning back-end.
User avatar
By Miika Kurkela
#48555
DrG wrote:the returning packet had useful information such as the MAC address of the S-20, which is needed to send commands.



Thank you DrG!

What a fine work. And important subject. With your advice I could make it work within few hours!

I'd like to suggest few ideas for your text and programs.

A) I couldn't compile the OrviboDiscoverytest before i moved the loop() function to the end of the whole code (Arduino 1.6.7, Win10, NodeMCU 1.0).

B) I couldn't compile the OrviboONOFFtest if I didn't move the loop() function to the end of that code an if I didn't move the S20_Subscribe() program to a place before the S20_on() program.

C) In the latter progam the lines
char cmdSubscribe[]=0x68,0x64,...
char cmdON[]=0x68,0x64,...
char cmdOFF[]=0x68,0x64,...
should be commented so that the reader could understand, where to put the MAC address and its little endian - and what numbers should be left untouched.

D) In both programs I preferred the baud rate 74880 because that way I can see that ESP8266 has booted properly.

I am preparing to make a Yuotube video on this subject. Is it OK if I refer to your this thread there?


Best regards
Miika K.
User avatar
By vksalian
#65413 Hello, Thanks for the information.

I am trying similar project where I am configuring ESP8266 in AccessPoint mode. But I could connect only 4/5 client devices to the AP. Am I missing something here or it is the default feature of ESP8266. When I looked at your project, you are using UDP protocol and I guess you did not face multi-connection issue in your project.
Please suggest me a guideline.
Thanks,
Vksalin
User avatar
By Ante
#87775 Just want to mention that I wrote an ESP8266 Arduino library for the S20 that is now available in the Arduino library manager. Since the old WiWo app was bugging out on my Android device I also implemented the S20 WiFi "pairing" process so you can use an ESP to configured the WiFi for the S20.
If you want to contribute the source code is available here:
https://github.com/antevir/OrviboS20_Arduino/

And BTW, the ESP8266 AP defaults to max 4 stations - I am guessing this was why vksalian was not able to connect more than 4 devices. You can specify the max number of stations as last argument in softAP():
Code: Select allbool softAP(const char* ssid, const char* passphrase = NULL, int channel = 1, int ssid_hidden = 0, int max_connection = 4);