This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
LIRC not connecting with pypilot_hat
#1
Hi, I am trying to get an IR remote control connected to my Pypilot.  the IR side seems to be working OK connected to GPIO 4 (as least I get pulse/space data when I run Mode2 that seems to make sense) and I have set up the lircd.conf file, but when I run pypilot_hat i get:

pi@openplotter:~/.pypilot $ pypilot_hat
hat start 1285.498098519
have gpio for raspberry pi
hat import done 1285.527343561
loading config file: /home/pi/.pypilot/hat.conf
failed to load /proc/device-tree/hat/custom_0 : [Errno 2] No such file or directory: '/proc/device-tree/hat/custom_0'
host pypilot
lcd process on 1703
lcd driver default False True
using glut
hat init complete 1286.718216583
1709 (process ID) old priority 0, new priority 19
set language en
failed to load lirc No module named '_client'
no lirc available No module named 'pylirc'
failed to import flask_babel, translations not possible!! [Errno 2] No such file or directory: '/usr/local/lib/python3.7/dist-packages/pypilot/hat/translations'
web process 1709
web process on port 33333

Any ideas?
Many thanks
David
Reply
#2
There are a lot of different versions.. I support 2 different versions but maybe not what you have installed.

What does "pip3 freeze" show?
Reply
#3
(2022-02-14, 12:24 AM)seandepagnier Wrote: There are a lot of different versions..   I support 2 different versions but maybe not what you have installed.

What does "pip3 freeze" show?
Hi Sean, many thanks for your quick reply. Here is the data you requested.
Regards
David

pi@openplotter:~ $ pip3 freeze
Adafruit-Blinka==5.9.1
adafruit-circuitpython-ads1x15==2.2.4
adafruit-circuitpython-bme280==2.5.1
adafruit-circuitpython-bmp280==3.2.3
adafruit-circuitpython-bmp3xx==1.3.1
adafruit-circuitpython-busdevice==5.0.1
adafruit-circuitpython-HTU21D==0.10.2
adafruit-circuitpython-ina260==1.2.4
adafruit-circuitpython-register==1.9.1
Adafruit-PlatformDetect==2.23.0
Adafruit-PureIO==1.1.8
asn1crypto==0.24.0
Babel==2.9.1
bidict==0.21.2
blinker==1.4
certifi==2018.8.24
chardet==3.0.4
Click==7.0
colorama==0.3.7
colorzero==1.1
cryptography==2.6.1
cupshelpers==1.0
decorator==4.3.0
entrypoints==0.3
Flask==1.0.2
Flask-Babel==2.0.0
Flask-SocketIO==5.0.0
gevent==20.9.0
gevent-websocket==0.10.1
gpiozero==1.5.1
gps==3.19
greenlet==0.4.17
idna==2.6
ifaddr==0.1.6
importlib-metadata==4.10.0
itsdangerous==0.24
Jinja2==2.10
keyring==17.1.1
keyrings.alt==3.1.1
MarkupSafe==1.1.0
numpy==1.16.2
olefile==0.46
openplotterDashboards==2.2.3
openplotterI2c==2.2.1
openplotterNetwork==2.1.5
openplotterOpencpnInstaller==2.2.3
openplotterSerial==2.2.3
openplotterSettings==2.9.1
openplotterSignalkInstaller==2.4.2
pexpect==4.6.0
pgzero==1.2
picamera==1.13
pigpio==1.44
Pillow==5.4.1
pycairo==1.16.2
pycrypto==2.6.1
pycups==1.9.73
pyftdi==0.52.0
pygame==1.9.4.post1
pyglet==1.5.11
PyGObject==3.30.4
pyinotify==0.9.6
PyOpenGL==3.1.0
pyOpenSSL==19.0.0
pypilot==0.33
PyRIC==0.1.6.3
pyserial==3.4
pysmbc==1.0.15.6
python-apt==1.8.4.2
python-engineio==4.0.0
python-socketio==5.0.3
pytz==2021.3
pyudev==0.21.0
pyusb==1.1.0
PyWavefront==1.3.3
pyxdg==0.25
PyYAML==3.13
reportlab==3.5.13
requests==2.21.0
rpi-ws281x==4.2.5
RPi.GPIO==0.7.0
RTIMULib==8.1.0
scipy==1.1.0
SecretStorage==2.3.1
simplejson==3.16.0
six==1.12.0
spidev==3.4
ssh-import-id==5.7
sysv-ipc==1.0.1
typing-extensions==4.0.1
ujson==1.35
urllib3==1.24.1
websocket-client==1.2.3
Werkzeug==0.14.1
wxPython==4.0.4
zeroconf==0.21.3
zipp==3.7.0
zope.event==4.5.0
zope.interface==5.2.0
Reply
#4
I don't even see lirc.

What if you just run python3 and type:
>> import lirc

or

>> import pylirc
Reply
#5
(2022-02-15, 03:45 AM)seandepagnier Wrote: I don't even see lirc.

What if you just run python3 and type:
>> import lirc

or

>> import pylirc

Sean, lircd is running as a service, but not lirc:

pi@openplotter:~ $ sudo systemctl status lircd

● lircd.service - Flexible IR remote input/output application support
   Loaded: loaded (/lib/systemd/system/lircd.service; enabled; vendor preset: enabled)
   Active: active (running) since Tue 2022-02-15 13:55:58 GMT; 1h 7min ago
     Docs: man:lircd(8)
           http://lirc.org/html/configure.html
 Main PID: 527 (lircd)
    Tasks: 2 (limit: 4915)
   CGroup: /system.slice/lircd.service
           └─527 /usr/sbin/lircd --nodaemon

Feb 15 13:55:57 openplotter lircd-0.10.1[527]: Notice: Driver  version: 0.10.0
Feb 15 13:55:57 openplotter lircd-0.10.1[527]: Notice: Driver  info: See file:///usr/share/doc/lirc/plugindocs/default.html
Feb 15 13:55:57 openplotter lircd-0.10.1[527]: Info: lircd:  Opening log, level: Info
Feb 15 13:55:57 openplotter lircd-0.10.1[527]: Notice: Using systemd fd
Feb 15 13:55:57 openplotter lircd-0.10.1[527]: Warning: Running as root
Feb 15 13:55:58 openplotter lircd[527]: lircd-0.10.1[527]: Info: Using remote: NEC.
Feb 15 13:55:58 openplotter lircd-0.10.1[527]: Info: Using remote: NEC.
Feb 15 13:55:58 openplotter lircd-0.10.1[527]: Notice: lircd(default) ready, using /var/run/lirc/lircd
Feb 15 13:55:58 openplotter systemd[1]: Started Flexible IR remote input/output application support.
Feb 15 13:55:58 openplotter lircd[527]: lircd-0.10.1[527]: Notice: lircd(default) ready, using /var/run/lirc/lircd

pi@openplotter:~ $ sudo systemctl status lirc

Unit lirc.service could not be found.

I tried your suggested commands, but get the same error that pypilot_hat generates:

pi@openplotter:~ $ python3

Python 3.7.3 (default, Jul 25 2020, 13:03:44) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import lirc
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/lirc/__init__.py", line 7, in <module>
    from .client import get_default_lircrc_path
  File "/usr/lib/python3/dist-packages/lirc/client.py", line 38, in <module>
    import _client
ModuleNotFoundError: No module named '_client'
>>> import pylirc
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'pylirc'
>>> 

Reply
#6
it is obvious then that your python "lirc" module is broken if you cannot import it

can you pip3 install pylirc? or put a new version somehow?
Reply
#7
Hi Sean, after a lot of fiddling around and running apt fix-broken, I have got lirc installed correctly and now I am getting a response on the hat webpage (33333).
Many thanks for all your help.
Regards
David
Reply
#8
I spoke too soon! It worked once but then I was back with

failed to load lirc No module named '_client'
no lirc available No module named 'pylirc'

lirc is working fine. When I run irw I see the correct keys for each button press on my remote.

I found some info on the web (https://github.com/project-owner/Peppy.doc/wiki/Pylirc) and installed pylirc

pypilot_hat then showed

failed to load lirc No module named '_client'
have old lirc for remote control

plus an error about a missing lircrc config file so I added an lircrc.conf file in /etc/lirc/lircrc. I believe this maps the outputs from lirc to strings for the application program to use.

begin
prog = pypilot_hat
remote = NEC (this is the name of my remote in lircd.conf)
button = One (this is the first button on my remote as defined in lircd.conf)
repeat = 0
delay = 0
config = One (I think this is the string that gets sent to pypilot_hat)
end

I am not sure I have the format of this correct but it removed the error when running pypilot_hat.

Still no keys appearing on the hat webpage (33333)!

I also have a problem with hat.conf: I edited this to read "host": "pypilot", but every time I restart the Pi it reverts back to "host" : "none"

Any help would be much appreciated.
Reply
#9
Hmm strange that it revers back to none.   There is recently zeroconf support to detect the pypilot host location. Does the hat script connect to the server?

The .lircrc file is currently inside mydata.tgz in the tinypilot repository.  I attached here but you have to rename to .lircrc
Reply
#10
The hat.conf file changing was down to me running 'pypilot_hat none'. I thought this would not run the LCD pop-up (I an running pypilot on the same pi as Open CPN).
Many thanks for the lircrc config file and I have modified this to suit my LIRC set up.
If I now run ircat and press buttons on the remote, it all works OK:

pi@openplotter:/etc/lirc/lircrc $ ircat -c /etc/lirc/lircrc/lircrc.conf pypilot
1
2
3
4
5
6
7
8
9

But still nothing appearing on 33333. I think I may abandon IR and use an RF remote wired directly to the pi GPIO.
Many thanks
David
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)