Tom Ritchford rec Amsterdam, Netherlands

CS106X Class Projects

hash all the art

Analyze an Arduino project

📦 continuous backups in Python 📦

Automatic handling of config files and data directories. Complies with the XDG Base Directory Specification.

CoreAudioFormatWriter development

work in progress for three.js

motor python code

BiblioPixel Animations that can run on time or direct commands

issue commentpi3d/pi3d_demos

Hi thanks for this info, I will follow your instructions and test this on the RPi tomorrow. Out of interest did you test just the phyeif bit on its own?

>>> import pyheif
>>> from PIL import Image
>>> im.size
>>> im.save("img_file.jpg"

hubertron

comment created time in 3 hours

issue commentpi3d/pi3d_demos

You were half right. It wasn't the MQTT Dash that was remembering the status, It was Mosquitto. I uninstalled then reinstalled it and the paused issue is resolved. Clearly though, it was MQTT Dash that somehow caused the issue in the first place. I have given up with MQTT Dash (I will stick with MQTT Dashboard) I deleted all the settings that I had created, deleted the appdata and cache from android, then uninstalled the app. I then tried reinstalling it, and all the settings were back as they were. The app developer's answer to why that was happening was 'Have no idea, sorry'

Duzeper

comment created time in 3 hours

issue commentpi3d/pi3d_demos

Hi, I can't see any where the variable paused can be set to True apart from by the MQTT server which must remember its status from a previous run. Setting paused to False just before the loop starts might not work all the time because it will depend on how quickly the MQTT server sends the message (i.e. it operates asynchronously, possibly over the internet). Maybe it would be a good idea to send MQTT messages from program at startup as mentioned before.

Showing the paused status with the text/date message is a good idea. I will add that and push the modified code to the develop branch as soon as I can.

Duzeper

comment created time in 8 hours

issue commentpi3d/pi3d_demos

I have assumed that the meat of PictureFrame2020.py, where the images are displayed and changed, is from line 349, 'while DISPLAY.loop_running():'

So to confirm the 'paused' status, I inserted 'print(paused) immediately before that line. When I run the program it does display 'True' I then replaced this line with 'paused = False' and the program now runs properly. I note that Paused is set to 'False' at line 36 but I cannot see anywhere where that could be changed to 'True'.

Can you think of any unintended consequences of this solution?

Re. displaying the paused status, would it be possible to display the word Paused on screen in a similar way to the filename display (but only while 'paused = True') I haven't quite (or rather, anywhere near) got my head around that part of the code yet. Any advice would be very much appreciated.

Duzeper

comment created time in 9 hours

issue commentpi3d/pi3d_demos

I suppose the PictureFrame program could send an MQTT message to switch paused off when it starts, it does seem a bit odd though. It's probably a good idea to make the code read the message payload as well as the topic. At the moment it just toggles the paused status but it would be easy to allow a payload "off", "on" or "" where the last toggles but the other two set it to a value. Or you could have two buttons: a pause on and a pause off.

Now I've done a few tries I can't get it to start with the pictureframe paused. So it's the opposite way round from you!

Duzeper

comment created time in a day

issue commentpi3d/pi3d_demos

I have downloaded an Android app called MQTT Dashboard and set up all three commands (Quit, Pause, Back) and all of them work perfectly, although the pause at start issue is still there. Bearing in mind my almost total lack of linux knowledge, I wondered if, when starting the frame, as a workaround at least, would it be feasible to send two commands one after the other ie. Command 1 to start the frame followed by Command 2 to run the pause/unpause command? Is that what the && command could do? Also, and this may actually be another new MQTT request, given that the pause topic is a toggle, is it possible for the frame to send back the pause status to the android client? If I set the time between images to, say 15 min, it could be some time before I realise that it is still paused!

Duzeper

comment created time in a day

startedrec/myers

started time in a day

issue commentpi3d/pi3d_demos

OK. the MQTT dash seems to work pretty well. I set the Address and Port to 192.168.0.190 and 1883 and in the pause option Topic (sub) is frame/paused I don't know what the other defaults are but Enable publishing is ticked and Update metric on publish immediately is ticked.

One thing I have found with MQTT is that it will 'remember' the status from the last time it was run, so if it closed down with paused True maybe it starts off paused. But actually, your problems sound more involved than that so probably not the culpret.

I did, however notice that the, frame/delete option in PictureFrame2020.py has a bug. It checks for and copies to ~/DeletedPictures however when it's started with sudo xinit ... that creates a directory /root/DeletedPictures which is not intended and I will fix.

Duzeper

comment created time in a day

issue commentpi3d/pi3d_demos

Hi OK I will check the paused at start issue (I didn't notice that but it might have been - the raspberry pi is in a different room from where my laptop is (nice warm kitchen!)) and set up MQTT dash and play with that. The fact that your last line works means that you must have the desktop running which will stop xinit working. i.e. you need to change your boot so you go to the command line. Even if you are logging in as a different session, the fact that there is already an X session using the display will give you that error.

Duzeper

comment created time in a day

issue commentpi3d/pi3d_demos

OK, to recap, I had done 1 & 2, and with parameter -m set to default=False, then the Picture Frame would run normally and display photos one after the other. However, when I set the parameter to True, then the frame is permanently paused. I confirmed this by issuing the command at 5, and the frame then unpauses. Command 5 then toggles pause/unpause as expected. So to clarify. When 'use_mqtt' is set to true, the frame starts paused!

Command 6 (quit) works fine as well I also added a 'back' command (mosquitto_pub -h localhost -t frame/back -m "" ) which also works fine. So command line instructions work fine.

However, when it comes to putting this into Android MQTT Dash, it gets a bit more complicated:- 'Quit' (app.publish("frame/quit", "quit", false, O);) works fine. 'Pause' (app.publish("frame/paused", "pause", false, O);) doesn't work at all 'Back' (app.publish("frame/back", "back", false, O);) sometimes goes back 1 image, sometimes 2 and sometimes to the first image in the folder. I wonder if trying a different MQTT app would be worth a try. That, however, would not solve the issue of the frame being paused at startup if MQTT is enabled!

PS I could not use command 4 (xinit.....) as it gave an error:-

pi@raspberrypi:~ $sudo xinit /usr/bin/python3 /home/pi/pi3d_demos/PictureFrame2020.py (EE) Fatal server error: (EE) Server is already active for display 0 If this server is no longer running, remove /tmp/.X0-lock and start again. (EE) (EE) Please consult the The X.Org Foundation support at http://wiki.x.org for help. (EE) XIO: fatal IO error 11 (Resource temporarily unavailable) on X server ":0" after 7 requests (7 known processed) with 0 events remaining. I can start the frame with 'python3 /home/pi/pi3d_demos/PictureFrame2020.py' so I assume that is not an issue. Duzeper comment created time in 2 days issue commentpi3d/pi3d_demos Martin, I'm working my way through the MQTT stuff now. What I did was (all via ssh to the RPi which is running at command prompt with no desktop): 1. install mostquitto-clients sudo apt install -y mosquitto mosquitto-clients 2. install paho-mqtt sudo pip3 install paho-mqtt NB I installed it for --user without sudo at first but running xinit has to be done as root using sudo so python couldn't find the module!!! 3. in PictureFrame2020config.py parse.add_argument("-m", "--use_mqtt", default=True) parse.add_argument( "--mqtt_server", default="localhost") parse.add_argument( "--mqtt_port", default=1883, type=int) parse.add_argument( "--mqtt_login", default="") parse.add_argument( "--mqtt_password", default="")  1. at the command line sudo xinit /usr/bin/python3 /home/pi/pi3d_demos/PictureFrame2020.py to start PictureFrame running 2. at the command line in a different terminal mosquitto_pub -h localhost -t frame/paused -m "" toggles the display paused or not 3. mosquitto_pub -h localhost -t frame/quit -m "" stops the program immediately and Ctrl-C in the ssh terminal I haven't altered PictureFrame from the version on pi3d_demos develop branch (it already has frame/paused and frame/quit functionality). Let me know if you did the same things and got a different result. Duzeper comment created time in 2 days issue commentpi3d/pi3d_demos Yes, I have found a method for editing /etc/fstab and it does appear to work. Many thanks for your help. I'm not sure I would have worked out the syntax by myself. No, I am sure. I would not! I'll carry on researching the permissions issue from a Windows mapped drive, but at least the ftp solution allows me to do what I need. PS Any progress with my MQTT query? Duzeper comment created time in 3 days issue commentpi3d/pi3d_demos @Duzeper It's hard to figure out the quirks and intricacies of the different programs! On my linux laptop I can certainly scp files to my raspberry pi - maybe there's a security aspect that means it's not safe from a windows computer. (I will boot up my old windows machine and have a go later.) The fact that ftp works ok is probably a random feature of some ancient component of the software rather than anything anybody planned. See https://m.xkcd.com/2347/ I did a quick search for raspberrypi mount on boot and there were some suggestions that you could edit /etc/fstab and put the mount intructions in there. Duzeper comment created time in 3 days issue commentpi3d/pi3d_demos Hi all, I managed to install pyheif on my RP3b+. Successfully built pyheif Installing collected packages: pycparser, cffi, pyheif Successfully installed cffi-1.14.3 pycparser-2.20 pyheif-0.5.1 But I cannot open/show any HEIC-Images in Pi3D. Following message is shown after cd /home/pi/pi3d_demos && python3 PictureFrame2020.py have you installed pyheif? trying to read exif cannot identify image file '/home/pi/Pictures/IMG_2214.HEIC' Couldn't load file /home/pi/Pictures/IMG_2214.HEIC giving error: 'NoneType' object has no attribute 'size' Any ideas? Thanks hubertron comment created time in 3 days issue commentpi3d/pi3d_demos Hi Paddy. I have done all that and the drive successfully mount to the path you mentioned, thanks for that. I still have some issues however. 1. This also needs to be repeated after a restart. Is there any way to automount the drive at boot? 2. more importantly, I still do not have permission to copy files from Windows to /home/pi/usbdrive I have mapped a Windows drive to \raspberrypi\pi\usbdrive\pictures and although I can read and open files, I cannot write to the folder. I get the message 'You need permission to perform this action' I have also tried your suggestion of scp from a Windows command line, 'scp D:\RaspberryPi\test.txt pi@192.168.0.191:usbdrive/pictures' After entering the raspberrypi password I get 'Permission denied' Also, why, in the Pi file manager, does the drive appear as '32 GB Volume', not usbdrive? Now my brain is starting to hurt. I have just successfully FTP'ed a file to /home/pi/usbdrive/Pictures with no issues with permissions. Clearly I could use this method to do what I need, but I am confused as to why I have permission to FTP a file but cannot copy a file using any other method. Duzeper comment created time in 4 days issue commentpi3d/pi3d_demos Hi I'm the other way round: it's so long since I used windows I can't remember much and the details are probably out of date. However I have had similar issues with write permission on external drives on linux and the solution I found was to mount the drive with specific usergroup permissions. The drive has to be formatted fat but I think that's normal for windows compatible drives. When I plug a drive into the USB of the pi and the X desktop is running it automatically gets mounted so the first thing I have to do is unmount it, so even before that I have to find what it's called in /dev/... And in order to map it I have to have previously created a directory on my pi. So this is the order I do it: 1. one off job create a drive to map to pi@raspberrypi:~$ mkdir usbdrive

1. job needed each time the drive is inserted. First find the reference, then unmount it, then remount it with required permissions
pi@raspberrypi:~ $lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 1 3.7G 0 disk └─sda1 8:1 1 3.7G 0 part mmcblk0 179:0 0 29.8G 0 disk ├─mmcblk0p1 179:1 0 256M 0 part /boot └─mmcblk0p2 179:2 0 29.6G 0 part / pi@raspberrypi:~$ sudo umount /dev/sda1
umount: /dev/sda1: not mounted.

pi@raspberrypi:~ \$ sudo mount -t vfat -o rw,exec,uid=1000,gid=1000,umask=022 /dev/sda1 usbdrive


Programs you start can then write and execute from the drive as well as read. The drive shows as the directory /home/pi/usbdrive (or whatever you called it) I don't know of windows GUI programs (I'm sure there will be some) but I think the standard command line scp will work from windows terminal/command line

scp C:/Users/Me/Pictures/NewPictures2020_11/* pi@192.168.0.22:usbdrive/pictures/2020


(where the destination directory will have to exist beforehand: ssh pi@192.168.0.22 ... mkdir usbdrive/pictures/2020 ...)

Duzeper

comment created time in 5 days

issue openedpi3d/pi3d_demos

I am new to Linux so need help. I don't want to keep my photos for PictureFrame2020 on the same sd card as the OS so I have put them on an external drive. My question is - How do I map a Windows drive to this card (/media/pi/32 Gb Volume) so that, in future, I can copy my photos from my Windows PC to the Pi? Also, although I have successfully mapped a drive to the /home/pi folder and I can read the contents, I cannot write to it even though I have set permissions to 777

created time in 5 days

fork olemb/nav

fork in 5 days

startedUninett/nav

started time in 5 days

startedrec/swirly-leap

started time in 6 days

issue commentpi3d/pi3d_demos

Paddy, another observation (probably not connected at all). While running pictureFrame2020 successfully (ie. With use_mqtt set to ‘False’) from a timer/service, Ctrl+C appears to have no effect, except I have noticed that it actually does stop the program, but several hours later.

Martin

From: paddywwoof notifications@github.com Sent: 14 November 2020 13:59 To: pi3d/pi3d_demos pi3d_demos@noreply.github.com Cc: Duzeper mhdashper@virginmedia.com; Mention mention@noreply.github.com Subject: Re: [pi3d/pi3d_demos] Request: New MQTT option (#31)

Martin, I haven't use MQTT on my setup for a while (the 'free' testing servers keep deciding they can't afford to keep being free) I will install an MQTT server on my RPi and check it out and see if I can reproduce you issue. Thanks for reporting the problem. Paddy

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/pi3d/pi3d_demos/issues/31#issuecomment-727211024 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AKJICPGAKCDV4P6GFJWUC7DSP2ELPANCNFSM4TPNZROA .

Duzeper

comment created time in 7 days

issue commentpi3d/pi3d_demos

Thanks.

A development. I have set up the ‘Quit’ MQTT command and it works fine.

I have also set up the ‘Pause’ command and that seems to work randomly. Sometimes the display un-pauses and displays the next photo but then that one will ‘freeze’. If I tap the pause button a random number of times then it will happen again.

Also, not sure if it is related but, sometimes, when I hit ‘quit’ or Ctrl+C I get a Terminal message ‘glGetError 0x500’

Martin

From: paddywwoof notifications@github.com Sent: 14 November 2020 13:59 To: pi3d/pi3d_demos pi3d_demos@noreply.github.com Cc: Duzeper mhdashper@virginmedia.com; Mention mention@noreply.github.com Subject: Re: [pi3d/pi3d_demos] Request: New MQTT option (#31)

Martin, I haven't use MQTT on my setup for a while (the 'free' testing servers keep deciding they can't afford to keep being free) I will install an MQTT server on my RPi and check it out and see if I can reproduce you issue. Thanks for reporting the problem. Paddy

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/pi3d/pi3d_demos/issues/31#issuecomment-727211024 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AKJICPGAKCDV4P6GFJWUC7DSP2ELPANCNFSM4TPNZROA . https://github.com/notifications/beacon/AKJICPA27BG2DAXFKD2YJ4TSP2ELPA5CNFSM4TPNZROKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOFNMFYEA.gif

Duzeper

comment created time in 9 days

PublicEvent

issue commentpi3d/pi3d_demos

Martin, I haven't use MQTT on my setup for a while (the 'free' testing servers keep deciding they can't afford to keep being free) I will install an MQTT server on my RPi and check it out and see if I can reproduce you issue. Thanks for reporting the problem. Paddy

Duzeper

comment created time in 9 days

issue commentpi3d/pi3d_demos

I have another issue Re. MQTT. When I first started experimenting, I tried to set up a ‘pause’ command but it seemed that it made the picture frame pause permanently. At this point I gave up with MQTT and uninstalled and reinstalled the picture frame. This appeared to fix the issue, so I carried on with setting up timer/services and all was working fine.

I have just gone back to trying MQTT but I have found where the ‘permanent pause’ is occurring. When I set parameter -m “use_mqtt” to True and run the picture frame, then it displays the first photo, but it never changes. A soon as I revert to “use_mqtt” – False it all works fine again.

I have set “mqtt_server” to my Raspberry Pi’s IP address and not changed the other mqtt parameters.

Is there a glitch in the code or (much more likely) am I doing something wrong ?

Martin

From: paddywwoof notifications@github.com Sent: 09 November 2020 16:44 To: pi3d/pi3d_demos pi3d_demos@noreply.github.com Cc: Duzeper mhdashper@virginmedia.com; Mention mention@noreply.github.com Subject: Re: [pi3d/pi3d_demos] Request: New MQTT option (#31)

@Duzeper https://github.com/Duzeper this is something that's cropped up a few times. Wolfgang asked about a couple of things that could be switched using MQTT (possibly with voice activation) and I need to sort out all the other good ideas and put something in the docs if I don't add the actual code.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/pi3d/pi3d_demos/issues/31#issuecomment-724132224 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AKJICPH62KZNODYVK3YONH3SPAL6DANCNFSM4TPNZROA . https://github.com/notifications/beacon/AKJICPATOQFANV372J53ST3SPAL6DA5CNFSM4TPNZROKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOFMUWDAA.gif

Duzeper

comment created time in 10 days

fork copperdong/myers

A tiny, generic implementation of the Myers diff algorithm

fork in 12 days

started time in 12 days

issue commentpi3d/pi3d_demos

@Duzeper this is something that's cropped up a few times. Wolfgang asked about a couple of things that could be switched using MQTT (possibly with voice activation) and I need to sort out all the other good ideas and put something in the docs if I don't add the actual code.

Duzeper

comment created time in 14 days

created repositoryolemb/nonsense

Nonsense

created time in 14 days

issue openedpi3d/pi3d_demos

I am using PictureFrame2020. Is there any chance of adding an MQTT option to toggle display/remove filenames interactively. Generally the photos I am displaying are travel photos and there are times when I think, 'I can't remember exactly where that is', but if I could briefly bring up the filename then I could look it up. Normally I don't want to display filenames so I have parameter -s set to '0.0'

created time in 14 days

more