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
Pypilot for Dummies -The Uninitiated
#31
I ran it twice again with the same results except this time when started pypilot_hat without sudo, the display started but then it garbled the screen. I took a picture of the screen but I don't know how to add it to the message here. I have set the perissions for spidev0.0. and 0.1. I also ran the script above.

The hat I have was purchased in June of last year, so the hardware would be of that timeframe.
Reply
#32
what does "gpio -v" show? The dependencies script should have upgraded it but just to be sure.

Is there any file in /root/.pypilot ? is there a /root/.pypilot/hat.conf? Also what about ~/.pypilot/hat.conf. Maybe delete these files if they were created by an older version and have incorrect settings.

I tried with an old hat with the nokia5110 and it works correctly for me as both user and root using openplotter after I fixed some issues yesterday, so I am not sure the differences you face. The screen is on spidev0.0, spidev0.1 is not used by the older hat, the newer one uses it for RF reception.
Reply
#33
There is a hat.conf file. It shows:

{"remote":false,"host":"127.0.0.1","actions":{},"pi.ir":true,"arduino.ir":false,"arduino.nmea.in":false,"arduino.nmea.out":false,"arduino.nmea.baud":4800,"lcd":{},"hat":{"lcd":{"driver":"nokia5110","port":"\/dev\/spidev0.0"},"lirc":"gpio4"}}


This is the gpio output:

pi@openplotter:~ $ gpio -v
gpio version: 2.60
Copyright © 2012-2018 Gordon Henderson
This is free software with ABSOLUTELY NO WARRANTY.
For details type: gpio -warranty

Raspberry Pi Details:
Type: Pi 3B+, Revision: 03, Memory: 1024MB, Maker: Sony
* Device tree is enabled.
*--> Raspberry Pi 3 Model B Plus Rev 1.3
* This Raspberry Pi supports user-level GPIO access.
pi@openplotter:~ $


Shouldd I delete the .pypilot directory too before an install?
Reply
#34
Does "ps aux | grep python" show any other processes running?

Can you try:
cd pypilot/hat/ugfx
python3 generate_version.py
make
./splash nokia5110

This should test the screen showing the pypilot logo. Ensure no other processes are running that might interfere. Sometimes the nokia screen has a poor contact so try pressing on the metal tab. Maybe I should upload my openplotter image because I did get it working, and I'm running out of clues to what your problem is.
Reply
#35
I went back and refolowed your directions and deleted the conf files. Then I deleted the pypilot directory and the openplotter-pypilot directory. Then I reinstalled twice. The display comes on now and says 92 No Motor Controller. The motor controller is connected. The pypilot part of openplotter is gone and my only access to the control screen is by typing localhost:8080. That is probably good enough. I would like to have it integrated with the rest of OpenPlotter but its not a show stopper. One big thing is that I can't find Pypilot in the home directory anymore. Its like it was installed somewhere in root.

I ran these last commands and they yied bad results. I assume its because the directory is gone.

pi@openplotter:~ $ sudo service pypilot start
pi@openplotter:~ $ cd pypilot/hat/ugfx
bash: cd: pypilot/hat/ugfx: No such file or directory
pi@openplotter:~ $ python3 generate_version.py
python3: can't open file 'generate_version.py': [Errno 2] No such file or directory
pi@openplotter:~ $ make
make: *** No targets specified and no makefile found. Stop.
pi@openplotter:~ $ ./splash nokia5110
bash: ./splash: No such file or directory
Reply
#36
Well I am not sure about exactly the problem, but it sounds like the display is working.

I am not sure what you mean "pypilot part of openplotter is gone" do you mean icons or links?

As for control, you can use the opencpn pypilot plugin or also type pypilot_control on command line.

As for the errors, you obviously deleted the pypilot directory but not needed as the screen is now working.

As for the motor controller. It is most likely because the serial port is not configured.

Try:
ls -l /dev/serial0

It must point to /dev/ttyAMA0, If you see /dev/ttyS0 then it is no surprise. It is also possible some other process is trying to access the port. Let me know if it points to /dev/ttyAMA0 or not.. The openplotter-pypilot plugin is supposed to detect this and correct it if needed so this could be a good test of that. So yeah all of this is supposed to just work without any manual steps you are going through. Really thanks for sticking by and it gives me good feedback.
Reply
#37
Okay, here is the output:

pi@openplotter:~ $ ls -l /dev/serial0
lrwxrwxrwx 1 root root 5 Sep 12 23:09 /dev/serial0 -> ttyS0


I assume that because pypilot is now installed separate from OpenPlotter, that it stands to reason that it wouldn't be set properly. I had problems with the serial ports with openplotter. The question now is what to do to fix.

I rebooted and now I have the scrolling with the command sudo pypilot_hat. The process runs continuously and repeats the last few lines.

pi@openplotter:~ $ sudo pypilot_hat
have gpio for raspberry pi
loading config file: /root/.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'
lcd process on 4882
4884 (process ID) old priority 0, new priority 19
set language en
failed to load lirc No module named 'lirc'
no lirc available No module named 'pylirc'
web process 4884
web failed to run process: [Errno 98] Address already in use: ('0.0.0.0', 33333)
4884 (process ID) old priority 19, new priority 19
web process 4884
web failed to run process: View function mapping is overwriting an existing endpoint function: index
4884 (process ID) old priority 19, new priority 19
web process 4884
web failed to run process: View function mapping is overwriting an existing endpoint function: index
4884 (process ID) old priority 19, new priority 19
Reply
#38
Yeah, you have two processes accessing the port at the same time. So this explains a lot of problems.

For the serial port function you can edit /boot/config.txt and /boot/cmdline.txt but... it would be nice to test out the upcoming openplotter-pypilot plugin integration...

git clone https://github.com/pypilot/openplotter-pypilot
cd openplotter-pypilot
sudo python3 setup.py install
openplotter-pypilot

From the serial tab there is a button to enable hardware serial
Reply
#39
I ran the commands and it looks like it installed but it didn't integrate with openplotter correctly. No pypilot icon is in the menu. There is an openplotter pipilot directory. I ran the menu editor but the program won't start when it is pointed at the /usr/local/bin/pipilot binary. I also can get it to start wit /usr/bin/pypilot. The screen is flashing again but in a different way.
Reply
#40
I dont know about integrating in the menu, sorry. Hopefully that works in the future. You can simply run the pypilot commands eg:
pypilot_control.

As far as flashing in a different way. It's really difficult to say but it is most likely either
1) another process is accessing the spi port.
2) screen connection is faulty (nokia5110 is bad for this) try pushing on the metal frame and see if anything changes
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)