Read the statement by Michael Teeuw here.
MMM-Navigate, Navigation inside MagicMirror with Rotary Encoder
-
@Eisblume
I tested wih modules of your config.My testconfiguration:
- Raspberry Pi 1
- MagicMirror v2.7.1
- npm v6.8.0
- node v8.9.0
- no electron (as i dont run/installable on Pi 1), i run
node serveronly
- display: Webbrowser
My rotary encoder works as follows:
Seite blättern
(press works and gives a red frame an a lock sign, cw an ccw dont work, as MMM-Pages isnt part of your config)News (mehr/weniger Details)
(press works and gives a red frame an a lock sign, cw an ccw works)Test notification
(press works, no cw or ccw functionality by design)News - mehr Details
(press works, no cw or ccw functionality by design)News - weniger Details
(press works, no cw or ccw functionality by design)Neustart MagicMirror (PM2)
(dont work in my testconfiguration, as i dont use PM on RPI1)Neustart
(press works, there is a pop up notification to press twice for reeboot, requires MMM-Remote-Control)Herunterfahren
(press works, there is a pop up notification to press twice for shutdown, requires MMM-Remote-Control)
Two ideas:
- wrong cabeling, here are the 3 pins for CW, CW and PRESS of your config.js (
GPIOPins: [26,20,19]
)
- messed up setup, try to save your config and reinstall raspian an MM
Greets
AxLED
-
Thank you so much for your help. But It still doesn’t work.
The cabeling is correct I checked it many times ;-)
The crazy thing is, when I remove ground, the press button works, but not the cw and cww.
I think, I will try a clean reinstall on my RPi3.
-
@AxLed
Also after clean install with nothing more, the default modules and MMM-Navigate and MMM-Remote-Controll it doesn’t work.Here you can see: https://youtu.be/G2eRoPxRPjU
Only when I remove ground, the press action works. But then, the cw and cww doesn’t work…
-
@Eisblume
Thanks for your reply, i tested at my pi with disconnected ground cable, but there is no press, cw or ccw working at all.
My last ideas:- can you messure your 5 cables if maybe one is interrupted
- maybe there are two versions of KY-040 on the marked, i have this one Amazon
- is your second rotary encoder shows same symptoms?
- did you connect + of rotary encoder to 5V once (which would be wrong and maybe damaged your GPIO PINs/chip)?
AxLED
-
@AxLed
Do not think that I am lying ;-), but it works fine, when I start MagicMirror and after that I start the python - script from here https://github.com/martinohanlon/KY040.cw, cww and press works absolutely fine.
It is very strange.
-
@AxLed
Ok, i fix it now for me.I know, it is a dirty code, but don’t found another solution :dizzy_face:
I attached the KY040 python script in the node_helper.js. Then everything works fine.
//node_helper.js /* Magic Mirror * Node Helper: {MMM-Navigate} * * By {AxLED} * {MIT} Licensed. */ //Debugging //tail -f ~/.pm2/logs/mm-out-0.log //tail -f ~/.pm2/logs/mm-error-0.log const Gpio = require('onoff').Gpio; ... const spawn = require("child_process").spawn; //Variables ... start: function() { var self = this; this.loaded = false; var process = spawn("python", ["/home/pi/Downloads/KY040/examples/python3.py"]); }, ... });
-
@Eisblume
No Problem, i am glad it works for you now, so you also did your first coding experiance.AxLED
-
@AxLed
Yes very interesting experiences :-) !Could you explain my how to start “Tagesschau in 100 Sekunden” in MMM-Navigate ??
-
@Eisblume
You need two things:- first: a modules which is able to stream 100Sec Tagesschau, i made a fork see MMM-Podcast2
- second: the right config (i posting only the relevant part)
.... { module: 'MMM-Podcast2', config: { // See 'Configuration options' for more information. omxargs: ' --win 0,0,1920,1080 -o both ' } }, { module: "MMM-Navigate", header: "Navigation", position: "top_right", config: { Alias: [ 'Tagesschau 100 Sekunden', 'Herunterfahren' ], Action: [ {notification:'BUTTON_PRESSED',payload:''}, {notification: "REMOTE_ACTION", payload: {action: "SHUTDOWN"}} ], GPIOPins: [26,20,19]//rotary cw, rotary ccw, rotary press (BCM Numbering) }, }, ...
AxLED
-
@AxLed said in MMM-Navigate, Navigation inside MagicMirror with Rotary Encoder:
{notification:‘BUTTON_PRESSED’,payload:‘’},
Thanks. Works perfect !!!