rawrool / Group7_SmartGarden

CECS 491a Project - Group 7 Smart Garden. Team Members: Raul Herrera, Jason Shortino, Arjun Chawla, Jose Hernandez.
0 stars 1 forks source link

add websocket for website to communicate with server #73

Open JosetheJedi opened 5 years ago

JosetheJedi commented 5 years ago

I will be implementing web sockets on the server and the website to test out web sockets before implementing it on the iOS and Arduino board.

The Web Socket will update the default watering schedule that is set on the website and send a emit a message to the server which will then broadcast a default schedule change to the iOS and the Smart Garden.

expected time: 3 hours

JosetheJedi commented 5 years ago

Added websockets for the settings page on the site. It took approximately 3.5 hours to complete.

I had issues with getting the right setting information when clicking on the default button, so i made a little hack to make dynamic element id for the button.

once I was able to get the schedule id for the new default watering schedule, i checked for the current default, and if there was none i just set the new default.

After the new default setting is placed, I created a broadcast message so that all other sockets connected to the same server will get the new settings.

JosetheJedi commented 5 years ago

Websockets on the website are done for now.

All that we need to do is implement the websockets on the iOS app and the Arduino