I have gotten the AWS (Amazon Web Services) IOT mgtt client working on my raspberry pi 3. I would like to add this script to a custom module on my magic mirror to enable Echo voice control the Pi I/O’s and provide visual status of these I/O’s on the Magic Mirror. I think I almost understand how to set up my module’s node_helper file with the mqtt client, but I don’t understand how it will start correctly when I load up Magic Mirror.
To start the mqtt client as currently installed outside the Magic Mirror app: you would use:
npm start /example/sampleproject.js -f ~/certs/
The ~/certs/ folder contains the private key and CA certificate need for authentication with the Amazon services.
I don"t understand how to do this within the Magic MIrror app. I have gone through all the scripts but don’t see/understand how to insure the npm cli args could be passed in when starting Magic Mirror.
Would someone have the knowledge/experience to point me what I need to read/study/understand to enable this?
Could it be as simple as hard-coding the path’s to these files in the script I will place in the node_helper folder?
Point me in the direction I need to go and I will do my best to figure it out!
@KirAsh4 Yeah, it is working for me as I want it. I figured it wouldn’t be overly useful to others anyhow since there was a lot of back-end work to do (namely setting up json streams that match the module code from the weather station, uploading to an appropriate location).
Screenshot of my current display is below. It updates every 5 seconds using data from my local Davis weather station running Cumulus software. The rain information (total daily rain on top left, current rain rate at bottom left) only display if there has been rain today or it is currently raining respectively. It will also display winds like “12 G23” if the winds hit gust criteria (over 18MPH gusts and more than 10MPH over the wind speed). It is pretty trivial to put any information you can get into the json file to display.
I’d be happy to try to properly modularize this if there is some interest, there’s just so many options and variations of stations/json exports/etc that I’m not sure I’d know where to start.
@paviro Ah, well thanks for the feedback. I’m hoping to get a bit of a hybrid between that app and pulling data from my own weather station. I’d like to keep the sunrise/sunset and the current conditions coming in from openweathermap and put my own station’s temp/wind. Was thinking modifying his would be a little easier than from scratch. 🙂 Maybe I’ll get lucky and he’ll see this and point me in the right direction.