Closed LeonVos closed 5 years ago
i think if u want to control all of them from the app i dont need to change anything on the esp. iam planning right know to implement more then one device in my app so that i could even call the function to post the http request to all of them. a mesh is more a way i think that all devices communicate with each other but the app can handlr more devices and chamge all of them so the work is done by tje app not the esp so we could keep the code on tje esp smaller and more efficient
When one has a Android phone, yes, but for iphone there's no app. LV
yeah but its the same thing, i think there is too much work for the esp to get this working the approach with an rpi running only mqtt is like 20 bucks??? and time beeing maybe we goet someone taking the same approach in creating an iphone app or something.
A big TODO, not an easy implmentation! For now the recommendation is to use MQTT and all clients connect to same topic. Alternatively as mentioned here call multiple rest API from one place (like an app). I've no app building experience.
I think WiFiMesh is a great solution for adhoc wifi network. When I have time I will try to get some examples of painlessMesh working. https://gitlab.com/painlessMesh/painlessMesh/blob/master/examples/webServer/webServer.ino
Hi @LeonVos,
using a mesh network sounds interesting but is not easy to implement in such a way that it works flawlessly for all users. I'd like to have it as easy and stable as possible. @TechOnlyGamer approach to send the same command to a number of ESPs looks like a easier solution. I also started working on a alternative web UI that could talk to more than one ESP, but it will take some time to find a nice and stable solution.
Best regards Tobias
Update: I have something working as of now,
@toblum It does not have the McLighing interface that you have here, but do you want me to create a branch for people to try?
if there is an RestAPI say Hello to my Android App
Hi @debsahu,
that sounds great. Can't wait to try that out. Will see if I can make the webinterface work for that. Is the API mainly the same?
Sure, create a branch as you like.
Regards Tobias
@toblum RESTful API, Async Websockets and Async MQTT API are the same. RESTful API is working and is same as ws282fx example for now. How do you test WebSockets, i.e. your favorite client?
Currently working on WiFiManager to set WiFi for internet, for now it is hard-coded. Also exporting tickers to Task Scheduler. Work in progress!
@toblum I created develop and experimental. Since this is experimental I will add my code there, not ready for public consumption yet. I cant delete any of your branches, I think only you can do that by going to 'settings'. I also recall that one can restore deleted branches, if needed as well.
Hi @debsahu,
I deleted some branches now. Much better overview. I hope I didn't delete too much.
I was using this chrome extension: https://chrome.google.com/webstore/detail/simple-websocket-client/pfdhoblngboilpfeibdedpjgfnlcodoo It has all the basic features and "just works".
Best regards Tobias
Anyone here willing to try the Meshy McLighting? https://github.com/toblum/McLighting/tree/experimental/Arduino/MeshyMcLighting
Meshy McLighting Server
WiFi and MQTT settings are still hard coded (Any ideas of making use of something like WiFiManager or something you have come across is appreciated). WiFi channel of the router needs to be manually specified, usually its channel 6 in USA as default.
Meshy McLighting Clients Do not enable WEBSERVER for now, not being used. WiFi channel must be the same as the WiFi router and Server.
@toblum created a favicon.ico, I dont know if you like it? It is there for me to see if an icon is displayed on chrome, we can change it because I spent a whole 3 minutes to create it! And what I need help with is it correctly implemented in the webpages <link rel='shortcut icon' type='image/x-icon' href='favicon.ico' />
? I dont see the icon thats why I'm asking.
Hi @debsahu,
I hope I'll find time at the weekend to try it out. So little time at the moment. I'm also working on an alternative UI for McLighting (https://github.com/toblum/McLightingUI). I'm trying to have a first version ready soon.
MeshyMcLighting seems to have a similar API, so it should be possible to build a UI that works on both. Did I see this right? So both together could be the new and improved v3 of McLighting. What do you think?
Regarding Favicon: I like it. But if we choose an icon we should have also bigger versions of it, so that we can provide homescreen icons for mobile devices. I havn't done that so far, because I didn't find a cool icon. Maybe some of the users has also some skill to create one.
All I can say again is that I'm totally impressed with your work. You can do in a short time what would have cost me months and years. Thanks again for your contribution.
Best regards Tobias
Thank you for your kind words, all the framework was present making my task easier.
Regarding WebUI development, my knowledge is 2000's HTML and basic JS! If I have a working example, I can maneuver around to figure things out. Now that you have a separate project for UI I can fiddle around a bit.
MeshyMcLighting has exactly same (MQTT and WS) API as McLighting, only difference being websocket is hosted here ws://HOSTNAME/ws (port 80) instead of port 81. McLighting's UI uses websockets but the version I have in there, uses RESTfulAPI. Regarding RESTfulAPI, yesterday I added everything that was in McLighting except for /set_speed, /set_brightness and /all which can all be done directly in /set_mode. I'm in touch with awesome developers at painlessMesh as well and trying to figure some kinks out regarding mesh networking. I also have to warn that running mesh network makes ESP8266 power-hungry, so a powerful power-supply is recommended or USB 3.0 or powered USB 2.0.
Hi Deb,
this looks great. I like how reliable the sync happens. This is a much better approach than my experiments with websocket calls to multiple nodes. This isn't really reliable as the ESP struggles with many WS connections open. I see that the master node can also work standalone. I first thought that you always need at least two nodes, but this is great. So this version could easily replace the current implementation. Regarding power consuption: I don't think it's a problem in most cases, as the strips draw the most power. But is it possible to turn off mesh functionality if you don't need it to save power? I didn't see that. As the API is almost similar, I will try to make the new UI work with your implementation. Should be easy. I had to order fresh ESPs and strips to have a meshy setup in parallel to my existing one. I hope they will arrive soon.
Greetings Tobias
@toblum A few things to note,
#define DISABLE_MESH_SETTINGS
that can be toggled in definitions.h
. Or I can upload what I got and someone can pitch in with creating this definition.EDIT: painlessMesh devlop version is just fantastic. no more sdk calls, no blocking which means MQTT reconnects are more reliable (can get rid of unreliable STA_IP change check that I use now). I am moving towards that and have to iron out some issues (DNS is not working).
Jep, looks like the mesh was a good brainer of me , @debsahu GOOD JOB. @toblum, nice job on the new controls.
And some new thing about the wifimanager, checkout ; https://github.com/kentaylor/WiFiManager#portal-continues-to-exist-after-configuration Ken has leveled this up, now when on dhcp you get feedback from the wifimanager on connection status and addresses, great idea.
Hi @debsahu,
I tried today with two nodes. Server works, but I could not get the client to sync. It always shows white and in Serial I see "----- WiFi Mesh Setup complete -----", but no sync. I set WiFi to my Wifi routers channel.
On the server I see: CONNECTION: stationScan(): ap_name CONNECTION: espWifiEventCb(): SYSTEM_EVENT_SCAN_DONE CONNECTION: scanComplete():-- > scan finished @ 73868592 < -- CONNECTION: scanComplete():-- > Cleared old aps. CONNECTION: scanComplete(): num=1, err=0 CONNECTION: scanComplete(): After getting records, num=1, err=0 CONNECTION: found : ap_name, -52dBm CONNECTION: Found 1 nodes CONNECTION: findConnection(1834281390): did not find connection CONNECTION: connectToAP():CONNECTION: connectToAP(): Already connected using manual connection. Disabling scanning.
Do you have an idea what's wrong here?
Regards Tobias
@toblum use IwIPv1.4 Higher-Bandwidth
Also what is the serial output on the client side? It should say connected to AP. On the server Serial output, it should say the WiFi channel that the clients needs compiling, does it match the WiFi channel on the router? I see that in your output you posted it says it's connected to 1 node, so I'm guessing client is connected? Could you change color or something ok the server to trigger a broadcast and see if syncing with client happens?
I had already selected this. But after reflashing multiple times it works now. I don't know what was wrong.
I have now one server with two clients. They all sync, but it takes always about 5 seconds until a change is reflected at the clients. In your video it was a instant reaction. Do you know that behaviour?
Ha yes. My local version is different only in that aspect, sorry I'll upload the my version with changes once I get to my computer. What you can do is replace all if(!taskSendMessage.isEnabled()) taskSendMessage.enableDelayed(TASK_SECOND * 5);
with taskSendMessage.enableIfNot(); taskSendMessage.forceNextIteration();
through out in server sketch.
Also mesh syncing and network stablilty takes time (5-10min). Make sure to keep them fairly far apart, 1.5m or so.
Ah! That explains it. Works great with the change. I think that I also have problems with the power. The ESP is getting fairly hot and flashing via USB often leads to restarts of the ESP. That could also be a problem. I have to look for a powered USB hub. That makes setup a bit harder for ma at the moment. I also noticed that the webpage isn't served very reliable, often the ESP just don't returns anything and the browser keeps loading.
Great job DEB !!! I will try a setup this weekend.
Will mesh be implemented now ?
Most probably not, but you can try the experimental branch. Other avenues of getting the same results are being explored.
@debsahu Hi Debsahu, could you elaborate on what may take it's place? i have a project coming up that would benefit from the mesh style setup.
@aidbish ArtNet or some implementation like that.
Cool, look forward to it.
Hi Debsahu, just a quick question regarding the mesh. i am currently using it till a new version is developed and it does actually work pretty well. what i do a have a problem with is turning them off. for some reason the off doesn't seem to function from the web page.. any ideas?
@aidbish which web UI are you using?
Im using the index.html one from mclighting experimental, couldn't see one in the meshmclighting folder.
it does look different to the standard one though. i even tried the standard one, but it didnt appear to change
@debsahu which UI should i be using
@debsahu I am unable to use mDNS with the example provided need a help here
Hi Tobias, Reading about the Android app :-) Is it an (great) idea to implement a mesh for all Mclithing esp's ?? ESP8266WiFiMesh or Wifiudpclient/server (#ifdef) or even BROADCAST? Not sure yet if there need to be a mas of code to be changed (like Server.on /....... etc)
But know for sure many would like to control ALL there McLighting esp's without a Mosquito/mqtt server but from the buildin webpage.
to be cont.....................
Regards Leon