SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By trevorwright0
#197840
Thanks for any help.

I've used Picaxe lots in the past, but I'm far from an expert. I was able to connect and program my Picaxe yesterday no problem. I reinstalled my OS today and Linaxepad gives me this error: Download for PICAXE-08M2 on /dev/ttyS0 Failed Error: Can't open port /dev/ttryS0. (err=5: input/output error).

I'm using Debian/Linux with the LXDE desktop environtment.
By trevorwright0
#197843
FYI:

I am using the same OS and same Picaxe.

I checked dmesg and it is detecting the Picaxe027 cable.

I have tried all of the port options within Linaxepad.

Thanks again for any help.
By paulvha
#197853
Trying to help.... When installing new software, it is common that some of the old parameters/setting are overwritten or removed and some new ones added. Can you tell a bit more about your environment and hardware?
I see you are using dmesg, which I normally use for USB. The port /dev/ttyS0 is normaly a serial port. Maybe there is an issue if the connection is USB. Then use the USB port (like /dev/ttyUSB0 or whatever naming the debian version is using) Can you check that in view, option and then port in Linaxepad?
If it is really serial: check there is no other program already using that port (e.g. sgetty is a often set to allow a user to login with a serial terminal)
Paul
By trevorwright0
#197854
Thanks for the help.

Here is the output from dmesg after connecting the cable:

[ 741.385455] usb 2-1.2: new full-speed USB device number 4 using ehci-pci
[ 741.500734] usb 2-1.2: New USB device found, idVendor=0403, idProduct=bd90
[ 741.500740] usb 2-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 741.500743] usb 2-1.2: Product: AXE027 PICAXE USB
[ 741.500746] usb 2-1.2: Manufacturer: Revolution

When I switch to /dev/ttyUSBx the error changed to:

(err=2: No such file or directory)

And sure enough nothing shows up under the /dev directory when I plug in the cable. So I'm thinking that is where my problem is....
By paulvha
#197855
seen some posts where USB device is not showing up after kernel update...cause : you first need to reboot.. I would expect you have done that.. but sharing just in case... can you share what hardware/software OS level etc you have? can try to help to find a solution..

a weird suggestion : Is there a device showing up on a different place (for instance /dev/usb/USB0 or something like that)
By trevorwright0
#197856
nothing shows up in /dev for the picaxe. However, when I plug in a usb stick it is detected in dmesg and it shows up in /dev. I tried rebooting. I'm going to try a live CD with another OS. I tried another 08m2 chip that had never been taken out of the bag but got the same results. I've got to go do some errands before the big storm hits us but I'll be back later today. Thanks again.

I'm using an Asus U31SD laptop
Linux debian 4.9.0-4-686-pae #1 SMP Debian 4.9.65-3+deb9u1 (2017-12-23) i686 GNU/Linux
running LXDE desktop.
By paulvha
#197857
Try to see whether kernel messages can help. remove USB, type: sudo tailf /var/log/messages (yes 'tail' with an 'f'). now connect the USB device and it should be detected and connect with the driver. It looks that the default FTDI driver needs some adjustments (that might have been removed with the update). see for details: http://www.picaxe.com/AXE027-Programming-Tool/

good luck with the storm :)
Paul
By trevorwright0
#197861
update: I have been able to get the cable to show up in /dev/ as ttyUSB0. I didn't realize you have use the modprobe commands on the Picaxe 027 driver instructions for Linux every time you reboot. Strange because I didn't have to type these commands before reinstalling my OS.

So now Axepad hesitates when trying to download the program then gives a new error:
Error: Hardware not found on /dev/ttyUSB0
If I change to another port (just to see what happens) I get err=2: No such file or directory

I typed your suggestion of tailf and here is the output:
Code: Select all
Jan 12 14:12:23 debian kernel: [  404.624236] usb 2-1.2: new full-speed USB device number 7 using ehci-pci
Jan 12 14:12:23 debian kernel: [  404.739320] usb 2-1.2: New USB device found, idVendor=0403, idProduct=bd90
Jan 12 14:12:23 debian kernel: [  404.739326] usb 2-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
Jan 12 14:12:23 debian kernel: [  404.739329] usb 2-1.2: Product: AXE027 PICAXE USB
Jan 12 14:12:23 debian kernel: [  404.739332] usb 2-1.2: Manufacturer: Revolution
Jan 12 14:12:23 debian kernel: [  404.742493] ftdi_sio 2-1.2:1.0: FTDI USB Serial Device converter detected
Jan 12 14:12:23 debian kernel: [  404.742564] usb 2-1.2: Detected FT232RL
Jan 12 14:12:23 debian kernel: [  404.743204] usb 2-1.2: FTDI USB Serial Device converter now attached to ttyUSB0
Jan 12 14:12:23 debian mtp-probe: checking bus 2, device 7: "/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2"
Jan 12 14:12:23 debian mtp-probe: bus: 2, device: 7 was not an MTP device
I tried a LiveCD (Puppy Linux) but got the same results.
By paulvha
#197863
progress... that is already good.... but more to do :-). I would expect that the "FTDI USB Serial Device converter now attached to ttyUSB0" was enough already..to get it working correctly. It should NOT need modprobe everytime. The current error seems to be related to Udev rules defined in /lib/udev/rules.d/ or /etc/udev/rules.d/ directory and libmtp library. Not sure why... as MTP stands for Media Transfer Protocol.

Have you tried to reinstall (maybe first remove) the related application software (as if it is from scratch) I expect that is (re)setting all the parameters correctly instead of discovering one after the other.... make sure to save however all the code/changes you have created before first . just in case...
By trevorwright0
#197865
I just verified that method #2 in the Picaxe USB manual of creating a new udev rule in /etc/udev/rules.d/99-picaxe027.rules doesn't seem to work for me, as I have to use the modprobe commands each reboot to get it to show up as /dev/ttyUSB0.

I can't reinstall the app as it was never actually installed per se. You just download the Linaxepad file and it's all ready to run, nothing to install.

I don't know anything about Udev rules or what I should be looking for but, I did notice that the udev rule /etc/rules.d/99-picaxe027 is the only rule in that directory. /lib/udev/rules.d/ has a whole bunch of rules in there. I tried copying the rule over to that directory but still no luck. Thanks again.
By paulvha
#197870
The document http://www.picaxe.com/docs/axe027.pdf (page 10) describes 3 options for linux.
Option 1 is manual modeprobe (every time) and that is what you use now.
Option 2 describes the usage of UDEV rule (basically when the kernel detects the USB vendor and USB product-Id it will run the modprobe for you),
Option 3 is a kernel adjustment and rebuild (only for advance users).

Can you do the steps described on http://weininger.net/how-to-write-udev- ... vices.html? Especially getting the udevadm output ? also check / copy&paste the complete content of the 99-picaxe027. Also get the content of one of the files in /ilb/udev/rules.d for reference.
Paul
By paulvha
#197872
let me add another article. Although this for mass storage USB, it look this can apply for you as well.
https://superuser.com/questions/1206664 ... -mass-stor
It states : " I found out that this is related to a recent change in the default Udev rules to set a catch-all rule for devices to be handled by MTP if they don't match any other udev rules for USB devices.".
The advice is to:
sudo cp /lib/udev/rules.d/69-libmtp.rules /etc/udev/rules.d/69-libmtp.rules
sudo nano /etc/udev/rules.d/69-libmtp.rules
add these 2 lines:
# exclude product: AXE027 PICAXE USB
ATTR{idVendor}=="0403", ATTR{idProduct}=="bd90", GOTO="libmtp_rules_end"
CNTRL+O to save
CNTRL+X to exit
sudo udevadm control --reload-rules (or reboot)
Paul