Trying to get 0/16/16 board up and running on Pi

Supporting 2.6 and up
Post Reply
Mastiff
Phidgetly
Posts: 21
Joined: Fri Sep 11, 2020 9:20 am
Contact:

Trying to get 0/16/16 board up and running on Pi

Post by Mastiff »

Hi! I'm not much of a programmer, but I wanted to use a 0/16/16 digital board that I had laying around in my boat to be able to remote control some things (lanterns, searchlight, audio amps, pumps and so on). I have installed the server and have that running. Node-RED connects to it at startup and says "Connect Success (127.0.0.1:5661)", so I assume that's not the problem. But "Open failed:PhidgetError: Open timed out" doesn't sound too good.

So I checked with phidget22admin -s first, and it sees the server (on two network cards, wifi to the cabib when it's docked and wired to the rest of the boat). I then tried the -R -d switches, and I got this:
MadMax - (2) Dictionary [Phidget22 Control]
(2/0/0) Dictionary
Shouldn't I see something else there to show that it's found the board? I know that the board's connected because lsusb gives me:
Bus 001 Device 007: ID 06c2:0044 Phidgets Inc. (formerly GLAB) PhidgetInterface Kit 0-16-16
I'd appreciate any help I can get! :mrgreen:
User avatar
mparadis
Site Admin
Posts: 660
Joined: Fri Oct 28, 2011 12:17 pm
Contact:

Re: Trying to get 0/16/16 board up and running on Pi

Post by mparadis »

The USB ports on the Pi are notoriously underpowered, so it's possible the board is not getting enough power to fully activate. Have you tried using a powered USB hub? You may also want to try testing the Phidget on another computer just to rule out the possibility of damaged hardware.
Mastiff
Phidgetly
Posts: 21
Joined: Fri Sep 11, 2020 9:20 am
Contact:

Re: Trying to get 0/16/16 board up and running on Pi

Post by Mastiff »

Thanks for the lightning fast answer. :D I don't think it should be a power problem on my Pi 3B+, it can run a mechanical hard drive without complaining, and shouldn't that be more power hungry then this board?

Also I found the log file, and there's something going on. Can that be because I have two network cards, or is this another problem? Note that both Node-RED and

Code: Select all

ps aux | grep phidget
shows that the server's running.
2020-09-11T17:11:33 <ERROR> phidget22net[startIPhidgetServer()] : failed to open server socket
mos_netops-unix.c+201 mos_netop_tcp_openserversocket() : (IO Failure) failed to bind socket: Address already in use
2020-09-11T17:11:33 <ERROR> phidget22net[startServer()] : failed to start server
2020-09-11T17:11:33 <ERROR> phidget22usb[PhidgetUSBScanDevices()] : libusb_get_string_descriptor_ascii() failed: LIBUSB_ERROR_IO - Input/Output Error.
2020-09-11T17:11:33 <ERROR> phidget22usb[PhidgetUSBScanDevices()] : libusb_get_string_descriptor_ascii() failed: LIBUSB_ERROR_IO - Input/Output Error.
2020-09-11T17:11:33 <ERROR> phidget22usb[PhidgetUSBScanDevices()] : libusb_get_string_descriptor_ascii() failed: LIBUSB_ERROR_IO - Input/Output Error.
2020-09-11T17:11:33 <ERROR> phidget22usb[PhidgetUSBScanDevices()] : libusb_get_string_descriptor_ascii() failed: LIBUSB_ERROR_IO - Input/Output Error.
2020-09-11T17:11:34 <ERROR> netsrv[runPhidgetNetworkServer()] : failed to start phidget server
Mastiff
Phidgetly
Posts: 21
Joined: Fri Sep 11, 2020 9:20 am
Contact:

Re: Trying to get 0/16/16 board up and running on Pi

Post by Mastiff »

I did check an external, powered USB hub, but that didn't help. With a Windows computer it worked flawlessly. I then wanted to wait until I got my new Pi 4, to see if there was a problem with the one I was using. But it doesn't work on my new Pi either, with or without the powered USB hub. What should be my next step here? Also is there an example Node-RED flow for Phidgets somewhere? I keep getting "Unsupported message topic" for the standard settings when I create a digital output node and try to inject in that.
Attachments
Phidgets Node-RED errors.png
User avatar
mparadis
Site Admin
Posts: 660
Joined: Fri Oct 28, 2011 12:17 pm
Contact:

Re: Trying to get 0/16/16 board up and running on Pi

Post by mparadis »

I suppose you can try running a local example instead of a network server based example to check if it's a problem with the network server. Try running the python DigitalInput or DigitalOutput example on the Pi.

In node-red, Phidget nodes only expect incoming messages that are formatted in a specific way. See the "methods" section of the distro page to see an example message. In short, you need to set the message topic to match the name of the method from the Phidgets Javascript API that you wish to call. The payload must be a JSON object that contains all of the parameters for that method, with names that match the parameter names from the API.
Mastiff
Phidgetly
Posts: 21
Joined: Fri Sep 11, 2020 9:20 am
Contact:

Re: Trying to get 0/16/16 board up and running on Pi

Post by Mastiff »

Thanks, but I'm afraid that didn't work either. I read a bit on the forum and found one guy who had a similar problem and fixed it by running the script sudo, but that didn't change anything. The output from the script is:
Traceback (most recent call last):
File "phidges.py", line 21, in <module>
main()
File "phidges.py", line 10, in main
digitalOutput1.openWaitForAttachment(5000)
File "/home/pi/Phidget22Python/Phidget22/Phidget.py", line 561, in openWaitForAttachment
raise PhidgetException(result)
Phidget22.PhidgetException.PhidgetException: PhidgetException 0x03 (Timed Out)
No Phidgets were detected at all. Make sure your device is attached.
And lsusb shows the board, along with all my other devices, all working:
Bus 002 Device 002: ID 0bc2:ab21 Seagate RSS LLC Backup Plus Slim
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 004: ID 1781:0c31 Multiple Vendors Telldus TellStick Duo
Bus 001 Device 003: ID 2001:f103 D-Link Corp. DUB-H7 7-port USB 2.0 hub
Bus 001 Device 006: ID 06c2:0044 Phidgets Inc. (formerly GLAB) PhidgetInterface Kit 0-16-16
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
I tried to repeat it after stopping the network server, but that didn't change a thing.
User avatar
mparadis
Site Admin
Posts: 660
Joined: Fri Oct 28, 2011 12:17 pm
Contact:

Re: Trying to get 0/16/16 board up and running on Pi

Post by mparadis »

Hmm. Out of curiosity, what happens when you run the manager example? Is it able to see the Phidget?

Also, which version of the 1012 is this? (1012_0, 1012_1, 1012_2, the old one with black terminals, etc)
Mastiff
Phidgetly
Posts: 21
Joined: Fri Sep 11, 2020 9:20 am
Contact:

Re: Trying to get 0/16/16 board up and running on Pi

Post by Mastiff »

No reaction at all, no. It's just staying on:
Opening....
Phidget Simple Playground (plug and unplug devices)
Press Enter to end anytime...
I unplugged and plugged it several times, both directly and in the powered hub.

As for the version, it says "Phidgets InterfaceKit v6.0, 0/16/16". I don't see any other version info on it. The VID/PID is 06c2:0044. It has green terminals, and I would guesstimate that it was bought around 2005, from the file dates of the earliest Girder files that refer to it.

Edit: Can other software on the Pi interfere? I have Node-RED with Tellstick Duo and a few other plug-ins, and I have SignalK, which is an NMEA (navigational) server, which uses the Apple cr@p Bonjour. Also I have J.River Media Center, but that shouldn't really matter. The network part of that is running on TCP port 16000. Finally I have it set up as a router with DHCP server and firewal, after this howto: https://linuxhint.com/raspberry_pi_wired_router/
User avatar
Patrick
Lead Developer
Posts: 634
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: Trying to get 0/16/16 board up and running on Pi

Post by Patrick »

type lsusb and see if the Phidget is detected on USB at all.

enable library logging and see if there are errors.

make sure you are running as root, or have installed the udev rules.

-Patrick
Mastiff
Phidgetly
Posts: 21
Joined: Fri Sep 11, 2020 9:20 am
Contact:

Re: Trying to get 0/16/16 board up and running on Pi

Post by Mastiff »

Thanks for chiming in! But I believe all that is answered in messages higher up the thread. I am seing the Phidget board on lsusb, I am running the server and scripts sudo and I did look at the log output of the server, which is printet a few posts up. Or is it another kind of logging you are refering to?
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests