Raspberry PI 4 mpf, mpf-mc install fail

163 views
Skip to first unread message

Bob Bevins

unread,
May 4, 2020, 10:50:14 AM5/4/20
to MPF Users
Has anyone successfully installed mpf, mpf-mc on a raspberry pi4?

It is failing with ffpyplayer because Cython unable to compile.

Building wheels for collected packages: ffpyplayer
  Building wheel for ffpyplayer (setup.py) ... error
  ERROR: Failed building wheel for ffpyplayer
  Running setup.py clean for ffpyplayer
Failed to build ffpyplayer
Installing collected packages: ffpyplayer, mpf-mc
  Attempting uninstall: ffpyplayer
    Found existing installation: ffpyplayer 4.3.1
    Uninstalling ffpyplayer-4.3.1:
      Successfully uninstalled ffpyplayer-4.3.1
    Running setup.py install for ffpyplayer ... error
  Rolling back uninstall of ffpyplayer
  Moving to /usr/local/lib/python3.7/dist-packages/ffpyplayer-4.3.1.dist-info/
   from /usr/local/lib/python3.7/dist-packages/~fpyplayer-4.3.1.dist-info
  Moving to /usr/local/lib/python3.7/dist-packages/ffpyplayer/
   from /usr/local/lib/python3.7/dist-packages/~fpyplayer
ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] =                       '"'"'/tmp/pip-install-ajbgtemz/ffpyplayer/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ajbgtemz/ffpyplayer/setup.py'"'                      "';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();ex                      ec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-rnwjs2tu/install-record.txt --single-vers                      ion-externally-managed --compile --install-headers /usr/local/include/python3.7/ffpyplayer Check the logs for full comm                      and output.

Bob Bevins

unread,
May 4, 2020, 10:56:24 AM5/4/20
to MPF Users
2020-05-04T10:47:14,912 Collecting ffpyplayer==4.2.0; platform_system != "Windows"

HUH, wondering why the scripts are detecting windows when it is being run on rasbian linux.

jabdoa

unread,
May 4, 2020, 3:03:29 PM5/4/20
to MPF Users
That usually means your setuptool is too old. However, I removed that line in dev because it seems to help of Linux for some users with video. It is not necessarily though. You can check out the mpf repo, remove it from setup.py and install in dev mode (http://docs.missionpinball.org/en/dev/about/contributing_to_mpf.html#install-mpf-in-development-mode) .

Jan

bob.b...@cnctechproductions.com

unread,
May 4, 2020, 3:34:54 PM5/4/20
to mpf-...@googlegroups.com
Hmmm.... I just checked and it is at latest version for python3.7


I will try your advice,

Thanks, Bob
--
You received this message because you are subscribed to the Google Groups "MPF Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mpf-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mpf-users/f1086caa-9fa7-4ce9-90a2-0f410731fc5a%40googlegroups.com.

bob.b...@cnctechproductions.com

unread,
May 4, 2020, 4:19:05 PM5/4/20
to mpf-...@googlegroups.com
So I forked the mpf and mpf-mc and installed no problem. I guess the issue has been fixed? I didn’t change anything and it worked.
To view this discussion on the web visit https://groups.google.com/d/msgid/mpf-users/038001d6224b%2413147e10%24393d7a30%24%40cnctechproductions.com.

bob.b...@cnctechproductions.com

unread,
May 4, 2020, 4:49:05 PM5/4/20
to mpf-...@googlegroups.com
OK, got v0.54.0-dev.29 running, but I am back to the 'WAITING FOR MEDIA CONTROLLER localhost:5050 after running mpf both.
To view this discussion on the web visit https://groups.google.com/d/msgid/mpf-users/038d01d62251%243fdf9140%24bf9eb3c0%24%40cnctechproductions.com.

bob.b...@cnctechproductions.com

unread,
May 4, 2020, 5:15:59 PM5/4/20
to mpf-...@googlegroups.com
ImportError: cannot import name 'bcm' from 'kivy.lib.vidcore_lite' (/home/pi/.local/lib/python3.7/site-packages/kivy/lib/vidcore_lite/__init__.py)
To view this discussion on the web visit https://groups.google.com/d/msgid/mpf-users/038f01d62255%247101b470%2453051d50%24%40cnctechproductions.com.

bob.b...@cnctechproductions.com

unread,
May 4, 2020, 5:19:53 PM5/4/20
to mpf-...@googlegroups.com
Here are the errors in the logs.

2020-05-04 17:13:32,325 : kivy : Window: Provider: sdl2(['window_egl_rpi'] ignored)
2020-05-04 17:13:32,355 : kivy : Window: Unable to find any valuable Window provider. Please enable debug logging (e.g. add -d if running from the command line, or change the log level in the config) and re-run your app to identify potential causes
egl_rpi - ImportError: cannot import name 'bcm' from 'kivy.lib.vidcore_lite' (/home/pi/.local/lib/python3.7/site-packages/kivy/lib/vidcore_lite/__init__.py)
File "/home/pi/.local/lib/python3.7/site-packages/kivy/core/__init__.py", line 63, in core_select_lib
fromlist=[modulename], level=0)
File "/home/pi/.local/lib/python3.7/site-packages/kivy/core/window/window_egl_rpi.py", line 12, in <module>
from kivy.lib.vidcore_lite import bcm, egl

sdl2 - RuntimeError: b'Could not initialize EGL'
File "/home/pi/.local/lib/python3.7/site-packages/kivy/core/__init__.py", line 71, in core_select_lib
cls = cls()
File "/home/pi/.local/lib/python3.7/site-packages/kivy/core/window/window_sdl2.py", line 152, in __init__
super(WindowSDL, self).__init__()
File "/home/pi/.local/lib/python3.7/site-packages/kivy/core/window/__init__.py", line 981, in __init__
self.create_window()
File "/home/pi/.local/lib/python3.7/site-packages/kivy/core/window/window_sdl2.py", line 290, in create_window
self.get_gl_backend_name())
File "kivy/core/window/_window_sdl2.pyx", line 224, in kivy.core.window._window_sdl2._WindowSDL2Storage.setup_window
File "kivy/core/window/_window_sdl2.pyx", line 74, in kivy.core.window._window_sdl2._WindowSDL2Storage.die

x11 - ModuleNotFoundError: No module named 'kivy.core.window.window_x11'
File "/home/pi/.local/lib/python3.7/site-packages/kivy/core/__init__.py", line 63, in core_select_lib
fromlist=[modulename], level=0)

2020-05-04 17:13:32,355 : kivy : App: Unable to get a Window, abort.
To view this discussion on the web visit https://groups.google.com/d/msgid/mpf-users/038f01d62255%247101b470%2453051d50%24%40cnctechproductions.com.

bob.b...@cnctechproductions.com

unread,
May 4, 2020, 10:16:50 PM5/4/20
to mpf-...@googlegroups.com
OK so, I have mpf running on windows machine no problem. Everything working.
I also have a machine running ubuntu 19 and it is also running on this fine.


I am trying to use gpio on raspberry pi 4, so I tried installing mpf on it, no dice it has the error about ffpyplayer and cython compiling issue.

So I said I can use one of the machines running mpf and use rpi remote gpio. That has errors also, so I am wondering if the raspberry pi stuff is not being maintained?

There is an error in the apigpio that is using a reserved word in python. As of python 3.7, async is a reserved word and apigpio is using that as a variable. I fixed that and now I get the following error.

Event: ======'shutdown'====== Args={}
closing notifier
required argument is not an integer
Traceback (most recent call last):
File "c:\users\bob\appdata\local\programs\python\python36\lib\site-packages\mpf\commands\game.py", line 228, in __init__
self.machine.run()
File "c:\users\bob\appdata\local\programs\python\python36\lib\site-packages\mpf\core\machine.py", line 693, in run
if not self.initialise_mpf():
File "c:\users\bob\appdata\local\programs\python\python36\lib\site-packages\mpf\core\machine.py", line 682, in initialise_mpf
self._crash_shutdown()
File "c:\users\bob\appdata\local\programs\python\python36\lib\site-packages\mpf\core\machine.py", line 729, in _crash_shutdown
self._do_stop()
File "c:\users\bob\appdata\local\programs\python\python36\lib\site-packages\mpf\core\machine.py", line 720, in _do_stop
self.shutdown()
File "c:\users\bob\appdata\local\programs\python\python36\lib\site-packages\mpf\core\machine.py", line 739, in shutdown
self._platform_stop()
File "c:\users\bob\appdata\local\programs\python\python36\lib\site-packages\mpf\core\machine.py", line 775, in _platform_stop
hardware_platform.stop()
File "c:\users\bob\appdata\local\programs\python\python36\lib\site-packages\mpf\platforms\rpi\rpi.py", line 197, in stop
self.machine.clock.loop.run_until_complete(self.pi.stop())
File "c:\users\bob\appdata\local\programs\python\python36\lib\asyncio\base_events.py", line 467, in run_until_complete
return future.result()
File "c:\users\bob\appdata\local\programs\python\python36\lib\site-packages\apigpio\apigpio.py", line 568, in stop
yield from self._notify.close()
File "c:\users\bob\appdata\local\programs\python\python36\lib\site-packages\apigpio\apigpio.py", line 396, in close
self.handle, 0)
File "c:\users\bob\appdata\local\programs\python\python36\lib\site-packages\apigpio\apigpio.py", line 461, in _pigpio_aio_command
data = struct.pack('IIII', cmd, p1, p2, 0)
struct.error: required argument is not an integer
To view this discussion on the web visit https://groups.google.com/d/msgid/mpf-users/039301d62259%24be9492d0%243bbdb870%24%40cnctechproductions.com.

jabdoa

unread,
May 5, 2020, 6:00:21 AM5/5/20
to MPF Users
from kivy.lib.vidcore_lite import bcm, egl

That error has something to do with the libs on the RPi. BCM is the chip of the PI.

The asyncio error should be fixed too. I forked the repository and fixed it. I think the package is called apigio-mpf or something.

Jan

bob.b...@cnctechproductions.com

unread,
May 5, 2020, 8:50:06 AM5/5/20
to mpf-...@googlegroups.com
Yeah, I removed the old one and installed the apigpio-mpf and the error I am getting is as follows:

File "c:\users\bob\appdata\local\programs\python\python36\lib\site-packages\apigpio\apigpio.py", line 474, in _pigpio_aio_command
data = struct.pack('IIII', cmd, p1, p2, 0)
struct.error: required argument is not an integer

Same thing. I don’t know which side this is on, because if I turn off the rpi, I still get the same message. So either the rpi is not responding to the request and it is erroring out at mpf or something wrong on mpf side.

-----Original Message-----
From: mpf-...@googlegroups.com <mpf-...@googlegroups.com> On Behalf Of jabdoa
Sent: May 5, 2020 6:00 AM
To: MPF Users <mpf-...@googlegroups.com>
Subject: RE: [mpf-users] Re: Raspberry PI 4 mpf, mpf-mc install fail

--
You received this message because you are subscribed to the Google Groups "MPF Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mpf-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mpf-users/ae78df92-b01c-4666-ae21-bae2a2b39eb7%40googlegroups.com.

bob.b...@cnctechproductions.com

unread,
May 5, 2020, 9:57:12 AM5/5/20
to mpf-...@googlegroups.com
Also what is weird is netstat -a shows pi listening on tcp6 :8888. Can tcp v4 connect to tcp6 socket?
That’s news to me. But pipgiod has no provisions for selecting v6 or v4.

Anyone have this running lately on newer hardware and software?
To view this discussion on the web visit https://groups.google.com/d/msgid/mpf-users/03ef01d622db%24b090cc30%2411b26490%24%40cnctechproductions.com.

bob.b...@cnctechproductions.com

unread,
May 5, 2020, 10:24:39 AM5/5/20
to mpf-...@googlegroups.com
OK I got it. The culprit was the pigpiod daemon. It is now working and running.
For some odd reason it doesn't like being started with systemctl, or I couldn't get it to do it correctly. As soon as I started it manually, it worked right away.

-----Original Message-----
From: mpf-...@googlegroups.com <mpf-...@googlegroups.com> On Behalf Of bob.b...@cnctechproductions.com
Sent: May 5, 2020 8:50 AM
To view this discussion on the web visit https://groups.google.com/d/msgid/mpf-users/03ef01d622db%24b090cc30%2411b26490%24%40cnctechproductions.com.

bob.b...@cnctechproductions.com

unread,
May 5, 2020, 11:11:51 AM5/5/20
to mpf-...@googlegroups.com
OKJ so I have mpf up and running talking to a raspberry PI.. I am now starting to get messages like: this is not supported on rpi yet.

Is there a list of things that are supported and not supported on rpi? I don’t want to get so far into this to find out I have to use something else because stuff is not supported. I just tried some basic stuff and am running into this.
To view this discussion on the web visit https://groups.google.com/d/msgid/mpf-users/002001d622e8%24e75d8070%24b6188150%24%40cnctechproductions.com.

bob.b...@cnctechproductions.com

unread,
May 5, 2020, 11:13:55 AM5/5/20
to mpf-...@googlegroups.com
set_pulse_on_hit_and_release_rule is one that is not supported yet. I would assume that is a basic needed rule.

File "c:\users\bob\appdata\local\programs\python\python36\lib\site-packages\mpf\platforms\rpi\rpi.py", line 250, in set_pulse_on_hit_and_release_rule
raise AssertionError("Not supported on the RPi currently. Write in the forum if you need it.")
To view this discussion on the web visit https://groups.google.com/d/msgid/mpf-users/002001d622e8%24e75d8070%24b6188150%24%40cnctechproductions.com.

bob.b...@cnctechproductions.com

unread,
May 5, 2020, 11:32:27 AM5/5/20
to mpf-...@googlegroups.com
So this is what I got out of the rpi.py that seem to not be supported. Can I get by without these functions?
I assume these have to do with coils and how they are released and safety releases and timings?
The last one clear_hw would assume clear Hardware, but I have no idea what it does.

set_pulse_on_hit_and_release_rule
set_pulse_on_hit_and_enable_and_release_rule
set_pulse_on_hit_and_enable_and_release_and_disable_rule
set_pulse_on_hit_rule
clear_hw_rule
To view this discussion on the web visit https://groups.google.com/d/msgid/mpf-users/002f01d622ef%24c9b85fc0%245d291f40%24%40cnctechproductions.com.

jabdoa

unread,
May 5, 2020, 1:33:52 PM5/5/20
to MPF Users
Can you post the full error from above where pigio was not running? I would like to handle that case properly.

For hardware rules the thing is: pigpio does not quite support that. It is not made specifically for pinball. Therefore it does not support rules in that sense. This probably could be implemented in c or rust within or next to pigpiod. Running it at 1kHz might work but you probably already need real time Linux to get it work reliably. Watchdog logic and such would also be a challenge. In general I would not recommend to directly drive coils this way. I created this for arbitrary peripherals such as DMDs, segment displays, more inputs, servos, steppers and such. You could turn it into a fully fledged pinball control system but it currently is not.

Jan

bob.b...@cnctechproductions.com

unread,
May 5, 2020, 3:01:33 PM5/5/20
to mpf-...@googlegroups.com
What recommendations would you have then?


-----Original Message-----
From: mpf-...@googlegroups.com <mpf-...@googlegroups.com> On Behalf Of jabdoa
Sent: May 5, 2020 1:34 PM
To: MPF Users <mpf-...@googlegroups.com>
Subject: RE: [mpf-users] Re: Raspberry PI 4 mpf, mpf-mc install fail

--
You received this message because you are subscribed to the Google Groups "MPF Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mpf-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mpf-users/186b6f0b-cca7-4649-b406-eb839a55d238%40googlegroups.com.

jabdoa

unread,
May 5, 2020, 4:03:11 PM5/5/20
to MPF Users
To make this more clear I added a section to the docs: http://docs.missionpinball.org/en/dev/hardware/rpi/index.html.

There are many options in MPF. Main options: P3-Roc or FAST (a few hundred bucks each). More DIY: OPP or APC (less than hundred bucks each). More in the docs: http://docs.missionpinball.org/en/dev/hardware/index.html


Jan

bob.b...@cnctechproductions.com

unread,
May 5, 2020, 4:37:26 PM5/5/20
to mpf-...@googlegroups.com
I don’t see the point then. I might as well use an fpga as another platform connected to mpf. I was under the impression this was working with the rpi.
I didn’t got the route of fast or proc as they are not a couple hundred, as I counted 700 for fast. I guess I will have to rethink this a bit.



-----Original Message-----
From: mpf-...@googlegroups.com <mpf-...@googlegroups.com> On Behalf Of jabdoa
Sent: May 5, 2020 4:03 PM
To: MPF Users <mpf-...@googlegroups.com>
Subject: RE: [mpf-users] Re: Raspberry PI 4 mpf, mpf-mc install fail

--
You received this message because you are subscribed to the Google Groups "MPF Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mpf-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mpf-users/35a5fce5-3878-427a-aef7-d710e6b238d7%40googlegroups.com.

jabdoa

unread,
May 6, 2020, 12:15:14 PM5/6/20
to MPF Users
Do you have FETs connected to the Pi? I mean this could probably be turned into some DIY platform. We can add hardware rules if that is what you need. Watchdog could be done in Linux but it would require some planning that it triggers when either pigpio or MPF stop or coils would stay on. The hardware side can be figured out but it will never be as good as dedicated controllers used by other platforms. APC is actually quite close. In their latest version there is even a slot for a PI on their PCB.

Jan

Reply all
Reply to author
Forward
0 new messages