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
[SOLVED] Can't "Engaged" Arduino
#1
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=p...uct_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...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
Reply
#2
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.
Reply
#3
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
Reply
#4
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
Reply
#5
Photo 
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/rbcsfzzmk0gdq2...2.png?dl=0

In the Serial window i can see ttyAMA0
https://www.dropbox.com/s/zb7ao0kp15cpco...1.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
Reply
#6
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?
Reply
#7
Hi,

here the wiring used:
https://www.dropbox.com/s/hvbfkd3e74uy51...5.jpg?dl=0

I have followed this Raspberry Pi 4 GPIO Pinout:
https://www.etechnophiles.com/wp-content...ebp/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
Reply
#8
Can you first write a zero file to fill the disk, then delete the zero file, then compress the image using xz?
Reply
#9
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...t-software
Reply
#10
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-...sp=sharing

I have done it with dd and compress with pishrink
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)