Hi I have updated my Node to node 8.0.0.
Now I have some issues with my Pimatic. It doesn´t start. Is it possible the update is the reason for the problem with pimatic?
Pimatic & Node 8.0
Hi I have updated my Node to node 8.0.0.
Now I have some issues with my Pimatic. It doesn´t start. Is it possible the update is the reason for the problem with pimatic?
@shgmongo yes. Downgrade!
Yes, Pimatic needs Node version 4.x.x to run!
pimatic-google-calendar | pimatic-wmi | pimatic-snmp | pimatic-wakeonlan |
Like my work? Then consider a donation
Follow me: www.thorstenreichelt.de
Thanks for the answer.
My problem is that I have also MagicMirror installed on the pi. MM need a higher Version of Node >4.
Can the problem be solved?
@shgmongo you could try the following tutorial. I was about to try it 2 weeks ago but didnt want to mess my system up.
Make sure you create a backup of your config just to be sure;
How-to run multiple node versions;
https://www.sitepoint.com/quick-tip-multiple-versions-node-nvm/
Yes, pimatic does not support node > 4
pimatic v0.9 has been released!
Support Pimatic and get some free stickers
Like us on Facebook
make it so !
@Gleno0h said in Pimatic & Node 8.0:
@shgmongo you could try the following tutorial. I was about to try it 2 weeks ago but didnt want to mess my system up.
Make sure you create a backup of your config just to be sure;
How-to run multiple node versions;
https://www.sitepoint.com/quick-tip-multiple-versions-node-nvm/
This allows you to switch between versions. I don’t know about running multiple versions simultaneously…
Every now and then I blog about pimatic at http://www.hendriks.software/tag/pimatic
@shgmongo said in Pimatic & Node 8.0:
Thanks for the answer.
My problem is that I have also MagicMirror installed on the pi. MM need a higher Version of Node >4.Can the problem be solved?
Use Docker! That allows you to sandbox applications. https://www.hendriks.software/tag/pimatic/
Every now and then I blog about pimatic at http://www.hendriks.software/tag/pimatic
@Jos-Hendriks thanks for the tip.
I tried it. I can start pimatic, but I cannot build a docker, I get this issue;
docker run -t -i -p 80:80 joshendriks/raspberry-pi3-pimatic
root@d7baa4295b58:/# nano Dockerfile.pimaticnode
root@d7baa4295b58:/# nano pimatic_confg.json
root@d7baa4295b58:/# docker build -t pimaticnode -f Dockerfile.pimaticnode .
bash: docker: command not found
root@d7baa4295b58:/# docker build -t pimaticnode -f Dockerfile.pimaticnode
bash: docker: command not found
I don´t know they are there automaticly. When I copy and paste your
nano Dockerfile.pimaticnode
they are there.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Tue Jul 11 19:17:11 2017
pi@raspberrypi:~ $ docker run -t -i -p 80:80 joshendriks/raspberry-pi3-pimatic
root@c8d71f97adb0:/#
root@c8d71f97adb0:/# nano Dockerfile.pimaticnode
@shgmongo could you post the file you are executing?
It doesnt make sense it wants to nano since nano is a text editor…
Edit; hm looks like an external file…
Did you create any code? If so, post it please
Which code or file do you mean? The one I start pimatic?
I have my own confg file for pimatic. But I can save it but i cannot build a docker.
root@c8d71f97adb0:/# pimatic.js
coffee-cache: compiling coffee-script file "startup.coffee"...Done
19:53:55.716 2017-07-11 Tuesday
19:54:04.732 [pimatic] Starting pimatic version 0.9.39
19:54:07.815 [pimatic, ppm] 2.15.12
19:54:07.921 [pimatic] Loading plugin: "pimatic-cron" (0.8.8)
19:54:08.601 [pimatic] Loading plugin: "pimatic-mobile-frontend" (0.9.11)
19:54:09.672 [pimatic-cron] the time is: Tue Jul 11 2017 19:54:09 GMT+0000 (UTC)
19:54:10.223 [pimatic-mobile-frontend] packing static assets
19:54:10.898 [pimatic-mobile-frontend] packing static assets finished
19:54:10.911 [pimatic-mobile-frontend] rendering html
19:54:19.801 [pimatic-mobile-frontend] rendering html finished
19:54:19.872 [pimatic] Listening for HTTP-request on port 80...
@shgmongo i think @Jos-Hendriks can help you out.
I wanted to see why the nano command is issued… I dont know docker, but i do think that it shouldnt nano…
nano is used to create the file “Dockerfile.pimaticnode” en edit it. You should run this on the host (e.g. directly on your pi), not from within the docker container.
Every now and then I blog about pimatic at http://www.hendriks.software/tag/pimatic
Back on-topic: I think we have to plan for an upgrade to node js version 8. As of April 2018 maintenance on 4.x ends: https://github.com/nodejs/LTS#lts-schedule1
Every now and then I blog about pimatic at http://www.hendriks.software/tag/pimatic
Maybe that would help with my issue.
Its boring that i could Not run Pimatic and Magie Mirror on one pi.
I have installed pimatic via docker with your image. Everything is working fine.
But the cron-timezone (UTC) on docker is different to the timezone on the hub (CEST).
How can I fix it?
Sebastian
@shgmongo Try to run the container with option “-e TZ=Europe/Berlin”. If this does not help special action may be required to build the docker image including timezone maps and to setup the timezone as part of the entrypoint run script. For example:
RUN apt-get update && apt-get install -y tzdata
# check if TZ is set, set to UTC otherwise, then execute:
sudo dpkg-reconfigure -f noninteractive tzdata
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
Using the base image I always create a docker image that includes all plugins I use. Recently I have added something to fix the timezone in there:
RUN ln -sf /usr/share/zoneinfo/Europe/Amsterdam /etc/localtime
I prefer the solution above however…
Here is my complete dockerfile, for reference
FROM joshendriks/raspberry-pi2-pimatic:4
RUN ln -sf /usr/share/zoneinfo/Europe/Amsterdam /etc/localtime
# Install pimatic modules
RUN cd /home/pimatic-app && npm install --unsafe-perm mysql pimatic-homeduino pimatic-mqtt@0.9.6 pimatic-ds18b20 pimatic-node-red pimatic-smartmeter-gas pimatic-tplink-smartplug
RUN cd /home/pimatic-app && npm install node-red-node-pushbullet
RUN cd /home/pimatic-app && npm install node-red-node-smooth
RUN cd /home/pimatic-app && npm install node-red-contrib-stoptimer
RUN cd /home/pimatic-app && npm install node-red-contrib-http-request
RUN cd /home/pimatic-app && npm install node-red-contrib-influxdb
RUN cd /home/pimatic-app && npm install node-red-node-ping
COPY config.master.json /home/pimatic-app/config.json
# Run pimatic once so that all coffeescripts are built and npm packages are downloaded and built
## Make sure that pimatic will exit when startup is completed
RUN cp /home/pimatic-app/node_modules/pimatic/startup.coffee /home/pimatic-app/node_modules/pimatic/startup.backup
RUN sed -i "s/initComplete = true/framework.destroy().then( -> exit(0) )/g" /home/pimatic-app/node_modules/pimatic/startup.coffee
## Run pimatic
RUN cd / && pimatic.js
## Restore startup.coffee and remove it from compiled cache
RUN rm /home/pimatic-app/node_modules/pimatic/startup.coffee \
&& mv /home/pimatic-app/node_modules/pimatic/startup.backup /home/pimatic-app/node_modules/pimatic/startup.coffee \
&& rm /home/pimatic-app/node_modules/pimatic/.js/startup.*
# Run pimatic.js at start of the container
ENTRYPOINT ["pimatic.js"]
EXPOSE 80 8000
Every now and then I blog about pimatic at http://www.hendriks.software/tag/pimatic