• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
MagicMirror Forum
  • Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
  1. Home
  2. randomnoise
  3. Posts
A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.
Offline
  • Profile
  • Following 0
  • Followers 0
  • Topics 3
  • Posts 62
  • Groups 0

Posts

Recent Best Controversial
  • RE: MMM-UkNationalRail - stops updating on mirror

    I got a reply from transport api- seems this issue is not just limited to my station:

    "
    Since last week we have been investigating an issue with live data for many Scottish trains stations being off by one hour. This is not effecting all stations in Scotland. In fact we had thought the issue was concentrated around Glasgow, so it’s useful to have this report of this example.

    In any case it seems likely to be an issue with the underlying data feed in these areas. We are working to pin down exactly what is going wrong, so that we can report it to the data suppliers. We shall let you know what we find."

    So in that event I’ve pressed on with modifying the module to avoid this data.

    I’ve moved my time check code to the processtrains function… It mostly works, except whenever I try to increment the counter once Ive skipped a row (so that the total values displayed should match the ‘max results’ parameter it stops working. Any ideas where I could be going wrong?

    for (var i = 0; i < counter; i++) {
    
                                var thisTrain = data.departures.all[i];
    							
    							//Check current time vs. departure & don't show it if it's past departure
    							var nowtime = new Date();
    							nowtime = ("0" + nowtime.getHours()).slice(-2) + ":" +
    							("0" + nowtime.getMinutes()).slice(-2) + ":" +
    							("0" + nowtime.getSeconds()).slice(-2);
    							if (thisTrain.expected_departure_time < nowtime) 
    							{
    							//Train already departed so we need to increment counter
    							counter++;
    							
    							} else {
    							//additional check to see if counter now exceeds length of data
    							if (counter > data.departures.all.length){
    								window.alert("counter exceeds data length");
    							}
    							else{
    								//push data
                                this.trains.data.push({
                                    plannedDeparture: thisTrain.aimed_departure_time,
                                    actualDeparture: thisTrain.expected_departure_time,
                                    status: thisTrain.status,
                                    origin: thisTrain.origin_name,
                                    destination: thisTrain.destination_name,
                                    leavesIn: thisTrain.best_arrival_estimate_mins,
                                    platform: thisTrain.platform
                                });
    							}
    							
    							}
                            }
    

    I threw in the alert to see when the if was proving as true, but if my counter value is over the limit it just throws the pop up straight away rather than sending through the data. Am I wrong in thinking it should at least be pushing the lines through up until the condition is met?

    posted in Troubleshooting
    R
    randomnoise
    Dec 6, 2017, 10:43 PM
  • RE: 55" Bedroom Mirror

    @Sean - I used Acrylic for my mirror & I would add that you have to do something to ensure that the surface is completely flat. I sized my acrylic to fit inside the bezel of the monitor (rather than removing it). Therefore as the acrylic isn’t exactly the same thickness as the bezel it means there is a slight gap between the top of the acrylic & the frame.

    I assume that the acrylic came on a roll at the factory, as mine has a definite curve to it. This means the mirror isn’t perfectly flat inside the frame. The result is not too bad, but does have a slight ‘fun house’ feel to it. Other than that the acrylics are not bad for the money.

    @Manick’s mirror does look awesome though & with that size I assume they’ve made sure its completely flat.

    posted in Show your Mirror
    R
    randomnoise
    Dec 4, 2017, 9:20 PM
  • RE: MMM-UkNationalRail - stops updating on mirror

    @nwootton - Haven’t heard back from the dev support… I suspect I’m not a big enough user of the service. It’s very strange it only seems to happen for my station though (I’ve only tried a few other stations from the list admittedly).

    I have been able to kind of sort it by hacking your .js though. Apologies for crudeness of code… 0_1512420443721_15-i-have-no-idea.jpg

    //With data returned
            if (this.trains.data.length > 0) {
                for (var t in this.trains.data) {
                    var myTrain = this.trains.data[t];
    				//Check current time vs. departure & don't show it if it's past departure
    				var nowtime = new Date();
    				nowtime = ("0" + nowtime.getHours()).slice(-2) + ":" +
    				("0" + nowtime.getMinutes()).slice(-2) + ":" +
    				("0" + nowtime.getSeconds()).slice(-2);
    				if (myTrain.actualDeparture < nowtime) 
    				{
    					//Do nothing
    				}
    				else{
                    //Create row for data item
    

    Its a purely string based comparison so works while time is in 24 hour format (and will bork around midnight, but I don’t get any trains later than that…) Also as its just not displaying the earlier ones I’d need to take that in to account in the loop counter (otherwise max results is also off)… Kind of at least proves it works.

    I’ll need to figure out a bit more about js programming to maybe make this work better. If I can do that & figure out how to use git more than just to clone would you be willing to have a config option for something like ‘trim departed trains from results’?

    posted in Troubleshooting
    R
    randomnoise
    Dec 4, 2017, 8:53 PM
  • RE: MMM-UkNationalRail - stops updating on mirror

    Ok, think I’ve figured this one out by manually loading the api json in my browser. The earlier train which is late is showing as being over 1 hour late (even though that’s not what it shows on the estimated departure time).

    This means that the trains following are still in the list even though they have departed.

    Either this has been happening every day atm, or there’s something screwy in the transport api database.

    0	
    mode	"train"
    service	"23540003"
    train_uid	"G81206"
    platform	null
    operator	"SR"
    operator_name	"Scotrail"
    aimed_departure_time	"12:56"
    aimed_arrival_time	"12:56"
    aimed_pass_time	null
    origin_name	"Aberdeen"
    source	"Network Rail"
    destination_name	"Glasgow Queen Street"
    category	"XX"
    service_timetable	
    
    status	"LATE"
    expected_arrival_time	"12:58"
    expected_departure_time	"12:58"
    best_arrival_estimate_mins	-54
    best_departure_estimate_mins	-54
    1	
    mode	"train"
    service	"23541003"
    train_uid	"G80279"
    platform	null
    operator	"SR"
    operator_name	"Scotrail"
    aimed_departure_time	"13:25"
    aimed_arrival_time	"13:24"
    aimed_pass_time	null
    origin_name	"Aberdeen"
    source	"Network Rail"
    destination_name	"Edinburgh Waverley"
    category	"XX"
    
    posted in Troubleshooting
    R
    randomnoise
    Nov 25, 2017, 1:57 PM
  • RE: MMM-UkNationalRail - stops updating on mirror

    It’s definitely not just that those trains being late in my earlier example either-

    0_1511617493458_Untitled4.png

    posted in Troubleshooting
    R
    randomnoise
    Nov 25, 2017, 1:45 PM
  • RE: MMM-UkNationalRail - stops updating on mirror

    Hmm, weirdly York station works ok.

    Maybe something is up with the api data for STN.

    0_1511617346950_Untitled3.png

    posted in Troubleshooting
    R
    randomnoise
    Nov 25, 2017, 1:42 PM
  • RE: MMM-UkNationalRail - stops updating on mirror

    I’ve expanded to show 8 results here as well…
    0_1511616890606_Untitled2.png

    posted in Troubleshooting
    R
    randomnoise
    Nov 25, 2017, 1:35 PM
  • RE: MMM-UkNationalRail - stops updating on mirror

    @nwootton, Well after a full rebuild I still have never been able to get to the bottom of why it locks up. Still does it on occasion (Although it seems to be less frequent these days).

    I have a new weird bug with the train times for you now though! Recently (may have been since the clocks changed, although I only noticed it the other day as I was checking time on a train I was going to catch) I seem to be showing times an hour behind! It’s bizarre as I don’t think there are any settings anywhere in the mirror for adjusting times other than the PI config settings (mine is showing correct time & UTC if I run a ‘date’ command in putty).

    Any thoughts on what this could be?

    0_1511616532091_Untitled.png

    posted in Troubleshooting
    R
    randomnoise
    Nov 25, 2017, 1:29 PM
  • Odd GPIO issue with 5V supply working with MMM-PIR-Sensor

    Hope someone can point me in the right direction here…

    As I’ve been having issues with a module I decided to do a new clean install of Raspian Jessie light & then go through the full set up procedure again. I used a new SD card for the install so I could retain the old one in event of any issues (and I’m glad I did).

    Got all my module sorted & it came to me getting MMM-PIR-Sensor working again. I cloned the git repository & ran the npm install from the folder. Now I noted that trying to run a “gpio readall” gave me a bash command not found error, so I instead followed the link in the pir sensor git hub page to wiring-pi (the node.js binding version of wiringpi). I installed this but then when running my gpio readall i got another error relating to not having the correct chip (I think wiring-pi is outdated & I’m running a pi 3 so it didnt install the correct up to date version of wiringpi), so I instead went direct to the wiringpi by drogon git page & installed it that way. Now gpio readall etc works fine. Note- I’ve given this story in case it’s relevant to my issue.

    Now my MMM-PIR sensor does function as it should if I sent the timeout value to some thing short like 10 secs so no issues with the module or wiring pi itself etc. Screen goes off, come back on when pir sensor activated.

    The issue I’m having is that every 2 mins or so, the PIR sensor itself is triggered (I know because it has a red LED which lights up). The sensor is becoming activated even if I’m not in front of it (I have also put it inside something to ensure its not getting any rogue heat to trigger it). It’s pretty regular - approx every 2 mins it goes off. This means that the mirror is constantly switching the screen back on.

    To troubleshoot I have used an identical PIR sensor which gives the exact same issue. I also tried a different 5V GPIO pin. Now the reason I know this is not a hardware fault is, if I put my old SD card in (with my old Jessie & MM install) it works absolutely fine, no rogue triggers.

    So my question is- what could be causing this? I know the PIR sensor will ‘trigger’ and the LED light up when it is first powered up so I can only imagine that somehow the 5V is not stable & is causing the sensor to power cycle every 2 mins or so. What I don’t get is that hardware-wise everything is the same. I’m using a good stable power supply with plenty of available current. So what software setting for my PI could be different in my new build? I may have done something in my previous build that I’m missing in this case (I had done lots of things from various web links to get other aspects of the mirror working), but I’m not sure exactly what I’ve missed this time around.

    I welcome your suggestions! Thanks.

    posted in Troubleshooting
    R
    randomnoise
    Nov 4, 2017, 9:39 AM
  • RE: MMM-Hive - error loading data

    Temporary fix seems to be using outside url with http instead of https.

    posted in Troubleshooting
    R
    randomnoise
    Nov 3, 2017, 4:00 PM
  • 1 / 1
Enjoying MagicMirror? Please consider a donation!
MagicMirror created by Michael Teeuw.
Forum managed by Sam, technical setup by Karsten.
This forum is using NodeBB as its core | Contributors
Contact | Privacy Policy