td3
Posts: 6
Joined: Mon Jun 07, 2021 3:22 am

Pi Pico

Mon Jun 07, 2021 3:28 am

Hi All,
I purchased a couple of Raspberry Pi Picos and I've been enjoying them. I want to use my PoE Power Extender Kit, Passive PoE to USB B adapter to place the two Pi Picos in two different areas of the house and read temperatures.

Basically, the Ethernet Adapter is just being used to extend the USB for long distance; however, for development purposes I will place the two Picos on USB hub and connect PC.

How to access the different Pi Picos on the USB hub?

Thanks,
td3

hippy
Posts: 10200
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Pi Pico

Mon Jun 07, 2021 4:25 pm

If I am understanding what you have correctly it seems your set-up, though it somehow involves Ethernet PoE, is no different to plugging two Pico into a USB hub connected to a Pi or other host, or plugging two Pico directly into a Pi or other host.

How the Pi or other host handles that will depend on what is running on each Pico. If both create virtual serial port links those will normally appear on the Pi as /dev/ttyACM0 and /dev/ttyACM1, COMx and COMy on a Windows PC. You can determine which is which by Pico serial number or interrogation, or each Pico could report which it is when it sends out its temperature data.

It's not clear how you will be using your Ethernet Adaptor or what that actually is - Perhaps you could provide more detail on that.

td3
Posts: 6
Joined: Mon Jun 07, 2021 3:22 am

Re: Pi Pico

Wed Jun 16, 2021 8:41 pm

Hello Again,

I'm basically using Ethernet to extend the wire length. However, I finally got a chance to put both Pi Pico's on the power USB Hub and cannot connect to the serial port using minicom.

I get the following error:

minicom: cannot open /dev/ttyACM1: Input/output error

I do see both Pi Pico here:
~$ ls -l /dev/ttyA*
crw-rw---- 1 root dialout 166, 0 Jun 16 15:32 /dev/ttyACM0
crw-rw---- 1 root dialout 166, 1 Jun 16 15:33 /dev/ttyACM1

I'm able to connect to only one Pi Pico which /dev/ttyACM0

Any ideas on why I can connect to Pi Pico on /dev/ttyACM1???

Thanks!

DarkElvenAngel
Posts: 1744
Joined: Tue Mar 20, 2018 9:53 pm

Re: Pi Pico

Thu Jun 17, 2021 1:59 am

Your user isn't in the dialout group.

For Raspberry PI OS this is easy to solve.

Code: Select all

sudo adduser pi dialout
This assumes you are running as user pi. Then you have to logout and back in for the changes to take effect.

hippy
Posts: 10200
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Pi Pico

Thu Jun 17, 2021 3:41 pm

DarkElvenAngel wrote:
Thu Jun 17, 2021 1:59 am
Your user isn't in the dialout group.
I thought the Pi user was in 'dialout' by default and it seems, whatever the user is, they are in the group if they can access /dev/ttyACM0 which is also 'dialout'.

It seems to be something more involved.

Can both Pico be accessed as /dev/ttyACM0 when only one is plugged in at a time -- remove both before plugging one in ?

If you plug one in and then the next, if you swap the order, does /dev/ttyACM0 always control the first plugged in or does only a specific Pico work ?

I would take a look with 'dmesg' to see if there have been any 'acm-cdc' breakages reported.

I would then remove both, reboot, plug one in then the other and take a look to see what 'dmesg' reports.

DarkElvenAngel
Posts: 1744
Joined: Tue Mar 20, 2018 9:53 pm

Re: Pi Pico

Thu Jun 17, 2021 7:46 pm

I honestly don't know I had to add pi to dialout on my pi but maybe there is more going on here. I saw the error and it looked familiar. Maybe newer version have the pi user in dialout but the older ones at least in my limited experience didn't.

td3
Posts: 6
Joined: Mon Jun 07, 2021 3:22 am

Re: Pi Pico

Thu Jun 17, 2021 7:59 pm

I believe I stated that I can only access one Pi Pico of the two. The goal is to access both Pi Picos via ttyACM0 and ttyACM1. Yes, initially for the first Pi Pico I had to add my user to dialout which has already been added.

See here for user univ:
~$ groups
univ dialout sudo wireshark nordvpn

Also, note that I had to add a udev rule which I called "99-PiPico.rules"to get the first Pi Pico to work. This is the contents of 99-PiPico.rules
~$ cat /etc/udev/rules.d/99-PiPico.rules
SUBSYSTEM=="usb", ATTRS{idVendor}=="2e8a", ATTRS{idProduct}=="0005" MODE="0666"


Now that I have two Pi Picos, I THINK I need to figure out how to add the Device ID number for each Pi Pico in the the udev rule, but I'm not sure.
Here's the output from lsusb
$ lsusb|grep Micro
Bus 001 Device 020: ID 2e8a:0005 MicroPython Board in FS mode
Bus 001 Device 019: ID 2e8a:0005 MicroPython Board in FS mode

Do you guys agree?

td3
Posts: 6
Joined: Mon Jun 07, 2021 3:22 am

Re: Pi Pico

Thu Jun 17, 2021 8:33 pm

I rebooted my Ubuntu laptop and noticed that the Device values change. So, adding the previous values of :
ATTRS{idDevice}="019" and "020" will not work well.

Those Device values changed... see below...

~$ lsusb|grep MicroP
Bus 001 Device 003: ID 2e8a:0005 MicroPython Board in FS mode
Bus 001 Device 002: ID 2e8a:0005 MicroPython Board in FS mode

User avatar
joan
Posts: 15650
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Pi Pico

Thu Jun 17, 2021 10:10 pm

My system doesn't have any rules and automatically creates /dev/ttyACMx. Perhaps the rule you added is the problem.

td3
Posts: 6
Joined: Mon Jun 07, 2021 3:22 am

Re: Pi Pico

Thu Jun 17, 2021 11:45 pm

The system creates both /dev/ttyACM0 and /dev/ttyACM1, but if I don't add the rule I get the following error in Thonny:

Unable to connect to /dev/ttyACM0: [Errno 5] could not open port /dev/ttyACM0: [Errno 5] Input/output error: '/dev/ttyACM0'

Also, what's weird is that I have to clear the Pi Pico and copy the "rp2-pico-20210418-v1.15.uf2" after reconnecting the USB.

The goal is to have three Pi Pico units running on a USB HUB and passing data to a Linux server via the serial interface. I can only get one device to work and not more than one.

User avatar
joan
Posts: 15650
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Pi Pico

Fri Jun 18, 2021 7:48 am

Without any added rules reboot, login, then connect your picos.

Then give the result of "ls -l /dev/ttyACM*".

hippy
Posts: 10200
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Pi Pico

Fri Jun 18, 2021 10:26 am

td3 wrote:
Thu Jun 17, 2021 7:59 pm
Also, note that I had to add a udev rule which I called "99-PiPico.rules"to get the first Pi Pico to work.
It simply works on a Pi under Raspberry Pi OS 32-bit without any changes so I guess it's an issue of using Ubuntu.

If you had to change things to make the first work you may have to change things to make others work but I have no idea what that would be.

I can't help further because I have never used a Pico with Ubuntu.

td3
Posts: 6
Joined: Mon Jun 07, 2021 3:22 am

Re: Pi Pico

Sat Jun 19, 2021 1:14 am

Thanks hippy. I'll get a a Raspberry Pi and try again. It will be about a week, but I'll share my results and post my results of getting three Pi Pico devices working.

Return to “General”