OpenMarine
[SOLVED] Can't "Engaged" Arduino - Printable Version

+- OpenMarine (https://forum.openmarine.net)
+-- Forum: Pypilot (https://forum.openmarine.net/forumdisplay.php?fid=17)
+--- Forum: General discussion (https://forum.openmarine.net/forumdisplay.php?fid=18)
+--- Thread: [SOLVED] Can't "Engaged" Arduino (/showthread.php?tid=3747)

Pages: 1 2


[SOLVED] Can't "Engaged" Arduino - faak - 2021-10-25

Hi,
thank you very much for this project.

I have Raspberry 4 Model B 4GB with OpenPlotter and pypilot installed.
I have bought a motor controller from the pypilot store
https://pypilot.org/store/index.php?rt=product/product&path=72&product_id=124
(2021 model)

I’ve been reading the workbook
https://github.com/pypilot/workbook/wiki
 
I follow this part:
https://github.com/pypilot/workbook/wiki/Step-14-The-Pypilot-Motor-Controller
I have connected the motor controller (4 pin)  to the GPIO.
I gave 12 v to the motor controller and a red light show up.
There is also a yellow light when I started openplotter.
I'm at home so there is not a rudder connected to the motor controller.

I can’t “Engaged” Arduino on the autopilot window.

I’m not a tech person and I try my best to find a solution, but I have no idea “where” to look at.
I have some experience with linux command line.
Can somebody provide me any advice?
Please tell me if you need some more information.

Thank you very much
Franco


RE: Can't "Engaged" Arduino - seandepagnier - 2021-10-26

If the controller is communicating with pypilot the yellow and green should be continuously flashing.

First ensure the /dev/ttyAMA0 is available:

ls /dev/serial0

it should point to /dev/ttyAMA0 not /dev/ttyS0

Next, ensure pypilot is running:

sudo systemctl enable pypilot
sudo systemctl start pypilot


Which autopilot window (there are multiple possible)


The current openplotter release has a very old pypilot version. If you update the openplotter-pypilot plugin from git it does much more to automatically configure and manage pypilot.


RE: Can't "Engaged" Arduino - faak - 2021-10-26

Thank you for the quick reply.

Raspbian GNU/Linux 10 (buster)
openplotter-pypilot is 2.1.1-beta

pypilot is running and the PyPilot window is from Openplotter menu -> Pypilot


The lights in the Motor controller are red and yellow but not blinking.

pi@ladylaura:~ $ ls /dev/serial0
/dev/serial0


Code:
pi@ladylaura:~/Downloads $ gpio readall
 +-----+-----+---------+------+---+---Pi 4B--+---+------+---------+-----+-----+
 | BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |
 +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
 |     |     |    3.3v |      |   |  1 || 2  |   |      | 5v      |     |     |
 |   2 |   8 |   SDA.1 | ALT0 | 1 |  3 || 4  |   |      | 5v      |     |     |
 |   3 |   9 |   SCL.1 | ALT0 | 1 |  5 || 6  |   |      | 0v      |     |     |
 |   4 |   7 | GPIO. 7 |   IN | 1 |  7 || 8  | 0 | OUT  | TxD     | 15  | 14  |
 |     |     |      0v |      |   |  9 || 10 | 1 | ALT0 | RxD     | 16  | 15  |
 |  17 |   0 | GPIO. 0 |   IN | 0 | 11 || 12 | 0 | IN   | GPIO. 1 | 1   | 18  |
 |  27 |   2 | GPIO. 2 |   IN | 0 | 13 || 14 |   |      | 0v      |     |     |
 |  22 |   3 | GPIO. 3 |   IN | 0 | 15 || 16 | 0 | IN   | GPIO. 4 | 4   | 23  |
 |     |     |    3.3v |      |   | 17 || 18 | 0 | IN   | GPIO. 5 | 5   | 24  |
 |  10 |  12 |    MOSI |   IN | 0 | 19 || 20 |   |      | 0v      |     |     |
 |   9 |  13 |    MISO |   IN | 0 | 21 || 22 | 0 | IN   | GPIO. 6 | 6   | 25  |
 |  11 |  14 |    SCLK |   IN | 0 | 23 || 24 | 1 | IN   | CE0     | 10  | 8   |
 |     |     |      0v |      |   | 25 || 26 | 1 | IN   | CE1     | 11  | 7   |
 |   0 |  30 |   SDA.0 |   IN | 1 | 27 || 28 | 1 | IN   | SCL.0   | 31  | 1   |
 |   5 |  21 | GPIO.21 |   IN | 1 | 29 || 30 |   |      | 0v      |     |     |
 |   6 |  22 | GPIO.22 |   IN | 1 | 31 || 32 | 0 | IN   | GPIO.26 | 26  | 12  |
 |  13 |  23 | GPIO.23 |   IN | 0 | 33 || 34 |   |      | 0v      |     |     |
 |  19 |  24 | GPIO.24 |   IN | 0 | 35 || 36 | 0 | IN   | GPIO.27 | 27  | 16  |
 |  26 |  25 | GPIO.25 |   IN | 0 | 37 || 38 | 0 | IN   | GPIO.28 | 28  | 20  |
 |     |     |      0v |      |   | 39 || 40 | 0 | IN   | GPIO.29 | 29  | 21  |
 +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
 | BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |
 +-----+-----+---------+------+---+---Pi 4B--+---+------+---------+-----


Is the Pin number 8 right? Should be 1 instead of 0?

Thank you


RE: Can't "Engaged" Arduino - seandepagnier - 2021-10-27

Yes, if you get /dev/ttyS0 then this is the issue.

You must edit /boot/config.txt and add
dtoverlay=disable-bt

Then you should find /dev/ttyAMA0 from ls -l /dev/serial0


RE: Can't "Engaged" Arduino - faak - 2021-10-28

Hi,

I have changed the /boot/config.txt, from dtoverlay=pi3-disable-bt to dtoverlay=disable-bt

[pi4]
# Enable DRM VC4 V3D driver on top of the dispmanx display stack
dtoverlay=vc4-fkms-v3d
max_framebuffers=2

[all]
dtoverlay=gpio-fan,gpiopin=14,temp=80000
enable_uart=1
dtoverlay=disable-bt


Code:
pi@ladylaura:~ $ ls -l /dev/serial0
lrwxrwxrwx 1 root root 7 ott 28 08:48 /dev/serial0 -> ttyAMA0

Yellow light still not blinking and i can't engaged the motor controller.

That's an image of it:
https://www.dropbox.com/s/rbcsfzzmk0gdq2m/OpenPlotter02.png?dl=0

In the Serial window i can see ttyAMA0
https://www.dropbox.com/s/zb7ao0kp15cpcoq/OpenPlotter01.png?dl=0

Code:
pi@ladylaura:~ $ dmesg | grep uart
[    0.000000] Kernel command line: coherent_pool=1M 8250.nr_uarts=1 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1 video=HDMI-A-1:640x480M@60,margin_left=24,margin_right=24,margin_top=16,margin_bottom=16 video=HDMI-A-2:640x480M@60,margin_left=24,margin_right=24,margin_top=16,margin_bottom=16 smsc95xx.macaddr=DC:A6:32:82:DB:F6 vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000  console=tty1 root=PARTUUID=389d8ea4-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
[    1.526508] uart-pl011 fe201000.serial: there is not valid maps for state default
[    1.528368] uart-pl011 fe201000.serial: cts_event_workaround enabled
[  836.652126] uart-pl011 fe201000.serial: no DMA platform data

I have istalled Arduino IDE on raspberry. 

/dev/ttyACM0 receive or send some data (here a sample of some data):
$GPGSA,A,3,01,22,21,17,04,31,19,09,,,,,2.12,1.01,1.87*0E
$GPGSV,3,1,10,01,59,132,36,03,75,007,27,04,56,195,32,06,10,311,*7E
$GPGSV,3,2,10,09,21,214,31,17,43,273,14,19,33,302,24,21,38,138,33*79
$GPGSV,3,3,10,22,60,064,29,31,22,065,08$GPVTG,,T,,M,0.020,N,0.037,K,A*25
$GPGGA,084823.00,4354.21526,N,01$GPRMC,084824.00,A,4354.21535,N,01023.33762,E,0.069,,281021,,,A*70
$GPVTG,,T,,M,0.171,N,0.317,K,A*21


Thank you


RE: Can't "Engaged" Arduino - seandepagnier - 2021-10-28

I thought you had uploaded your sd card image at first.. if you can do that I could verify it.

Otherwise, I think the issue maybe wiring, or a separate program accessing the port still. Can you show a picture of the wiring used? Can you try switching tx and rx?


RE: Can't "Engaged" Arduino - faak - 2021-11-01

Hi,

here the wiring used:
https://www.dropbox.com/s/hvbfkd3e74uy513/20211101_145815.jpg?dl=0

I have followed this Raspberry Pi 4 GPIO Pinout:
https://www.etechnophiles.com/wp-content/uploads/2021/01/R-Pi-4-GPIO-Pinout-1.jpg?ezimgfmt=ng:webp/ngcb40

I have used:

17 pin (3,3 v) (red cable)  ---> Red cable (Arduino)
20 pin (ground) (white cable) ----> Black cable (Arduino)
8 pin (uart tx) (green cable) ---> Green cable (Arduino)
10 pin (uart rx) (yellow cable) ---> Blue cable (Arduino)

I have tried to switch the uart cables but nothing happen.

The sd card image is 32 gb, i 'll try to send to you in private.
Thank you


RE: Can't "Engaged" Arduino - seandepagnier - 2021-11-02

Can you first write a zero file to fill the disk, then delete the zero file, then compress the image using xz?


RE: Can't "Engaged" Arduino - ironman - 2021-11-02

Hey faak, what's your pypilot version? This is how you can tell:

pi@openplotter:~/pypilot $ cat /usr/local/bin/pypilot

#!/usr/bin/python3
# EASY-INSTALL-ENTRY-SCRIPT: 'pypilot==0.32','console_scripts','pypilot'

If you have an old version, here's how to upgrade: https://github.com/pypilot/workbook/wiki/Step-8-Looking-under-the-hood-of-openplotter#updating-the-pypilot-software


RE: Can't "Engaged" Arduino - faak - 2021-11-02

Thank you ironman


Code:
pi@ladylaura:~/.pypilot $ cat /usr/local/bin/pypilot

#!/usr/bin/python3
# EASY-INSTALL-ENTRY-SCRIPT: 'pypilot==0.32','console_scripts','pypilot'
__requires__ = 'pypilot==0.32'
import re
import sys
from pkg_resources import load_entry_point

if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
    sys.exit(
        load_entry_point('pypilot==0.32', 'console_scripts', 'pypilot')()
    )

Unfortunately it doesn't solve the problem.

Here the sd card image:
https://drive.google.com/file/d/1htBDCV-8WEdYCiKGGCNoy2DVShjV7yWV/view?usp=sharing

I have done it with dd and compress with pishrink