@sdetweil
Thank you!
Ill need some time to try it out.
Mechanical or should I say, woodwork is finished. I’m still waiting for short hdmi cable, PIR sensor and hinges I ordered… It looks sexy alredy! Can’t wait to see it working.
@sdetweil
Thank you!
Ill need some time to try it out.
Mechanical or should I say, woodwork is finished. I’m still waiting for short hdmi cable, PIR sensor and hinges I ordered… It looks sexy alredy! Can’t wait to see it working.
@sdetweil said in MagicMirror and adruino over ethernet:
@Kereknjek cool. You could make a little change and have it return just data.
If the path is sensor1, send just sensor1’s data. Etc.
Pretty easy, just a case stmt… you could make it json data pretty easy too…
The request could ask for a sensor or block of sensors, and send raw data.
Yes! That is what i’m looking for.
But discussion went to arduino side.
My problem is that I don’t know how to do it at magic mirror side.
Yes. Plus, if I would want to make any modifications to webpage, first I would have to shutdown arduino and whole solar system, pull sd card out, modify page, plug sd card back in and restart sytem.
If sd card gets damaged in any way or get slow for some reason (had one like that on my 3D printer), whole system running on that arduino gets slow and unuseable.
It’s not stupid question.
If arduino serves webpage, it should be served from sd card.
To use sd card, you have to use sd card library, make decisions wether client wants whole web page or just data packets…
All that takes a lot of memory and time to process. And arduino is slow and low on memory compared to RPi.
For arduino is much simpler to detect “give me data” and send sensor ID and value.
Plus, in my case, arduino mega has 16 amperemeters to read and 18 outputs to regulate.
I wouldn’t like it if it gets stuck in code while inverter is working at full capacity. It could become fire hazard.
@sdetweil
That part is perfectly clear.
Here is C/P of what I am using now:
client.println("< !DOCTYPE HTML >");
client.println("< html >");
client.print("Napon panela: ");
client.print(PanelU);
client.println(" V < br/>");
client.print("Struja panela: ");
client.print(PanelI);
client.println(" A < br/>");
client.print("Napon baterije: ");
client.print(BatU);
client.println(" V < br/>");
.
.
.
client.println(“< / html >”);
That is slightly modified ethernet server sample program from ethernet library.
Edit: had to add spaces because html wasn’t showing.
I think that this is way to extensive for my knowledge. I can’t make heads or tails out of it…
@sdetweil said in MagicMirror and adruino over ethernet:
@Kereknjek I would see this module… MMM-ArduPort and how to send data from the arduino to the pi via serial
I also had added an http server to my arduino ESP8266 NodeMCU and provided apis for data access as another route, which keeps the devices from having to be physically wired together
Your MMM-ArduPort module looks EXACTLY like what I had in mind!
I’ll give it a detailed examination. :D
Thank you!
I’ll need some time to digest all the info you have provided. :smiling_face_with_open_mouth_cold_sweat:
Arduino sends data formated as simple HTML page. Pure text.
Hello, everyone!
I’m new here and to java programming. So I’ll have a lot of questions…
I’m in process of buinding MagicMirror as a door for my electrical cabinet in my house.
Anyway, I have build my own solar system using store bought solar panels and charge controller. Batteries are pulled from electrical forklift (460 kg) and as inverter, I’m using pure sine wave UPS used for powering servers in company I work at.
To manage the system I’m using arduino nano wich is measuring panel voltage and current, battery voltage, battery current and current direction, inverter current, inverter temperature, and charge controller temperature.
Data is transfered to arduino mega via rs485 located at my electrical cabinet. There arduino mega measures power usage and switches devices between solar and mains acording to load so battery doesent fall under 90% and maximum posible power produced by solar panels is used.
Arduino mega, located at electrical cabinet, is running HTTP server to wich I can connect from my PC or mobile to view current status, statistics and errors.
Now I want to make module for MagicMirror to display that data.
Allso, I’m upgrading my natural gas heating system. I’m adding wood furnace and solar collectors. System will use similar management based on arduino and will probably be connected to MagicMirror.
My problem is that I have no idea how to make javascript connection to arduino, nor how to send requests. But I can make responses from arduino in any format.
P.S.
Incidently, my surname is Magic. :smiling_face_with_sunglasses: