axe027 and linux mint

GAP

Senior Member
Just loaded axepad for linux and can't connect to my axe027
Followed the instructions on the axe027 page

I put this into terminal.
sudo modprobe ftdi_sio
sudo chmod 777 /sys/bus/usb-serial/drivers/ftdi_sio/new_id
sudo echo "0403 bd90" > /sys/bus/usb-serial/drivers/ftdi_sio/new_id
sudo adduser your_name dialout

Below is a screenshot of what I get when searching for USB devices AXE 027 is on Bus 3 Device 2

lsusb screen shot .png

Not sure if this is a linux problem or an axepad problem.
 

Attachments

GAP

Senior Member
Second screenshot of what I am getting when trying to configure axepad to see axe 027 (because I could only put 2 into first post)

search error.png
 

hippy

Technical Support
Staff member
It's a Linux issue; it can see the cable but hasn't created the /dev/ttyUSB0 device.

Will have to check why that may be. Others are welcome to chip in.

Added :

I put this into terminal...
sudo adduser your_name dialout
Did you replace the your_name with your login username ?

Also you may need to logout and login or reboot for that to take effect.
 

GAP

Senior Member
It's a Linux issue; it can see the cable but hasn't created the /dev/ttyUSB0 device.

Will have to check why that may be. Others are welcome to chip in.

Added :



Did you replace the your_name with your login username ?

Also you may need to logout and login or reboot for that to take effect.

I did put my user name in and did logout and reboot.

Will wait for any help available
 

steliosm

Senior Member
Gap, next time you plug in the cable in the computer get the dmesg output and post it here so we can see if Linux loads up the module and creates the device (/dev/ttyUSBX).

The sudo command at the end should be:
sudo adduser graeme dialout

You can verify the results by looking at /etc/groups and cheking if your username is listed next to dialout group.
 

GAP

Senior Member
Gap, next time you plug in the cable in the computer get the dmesg output and post it here so we can see if Linux loads up the module and creates the device (/dev/ttyUSBX).

The sudo command at the end should be:
sudo adduser graeme dialout

You can verify the results by looking at /etc/groups and cheking if your username is listed next to dialout group.
Put dmesg into 'terminal' and all I got was a couple of pages about my wifi dongle.

sudo adduser graeme dialout returns "graeme is already part of user group"

I honestly do not know what I am doing with linux
 

Jeremy Harris

Senior Member
If dmesg isn't showing the USB port for the AXE027, then that suggests that the ftdi driver hasn't installed for some reason. It doesn't seem to be a dialout user group permissions problem, AFAICS, that is a later thing, done once the USB serial port driver is loaded and has been allocated.

If you use this command from the terminal:

Code:
dmesg | grep FTDI
then it should return some strings detailing the FTDi driver as being installed correctly and giving the new USB serial port designation (probably something like ttyUSB0). It is the latter port designation that needs to be added to the dialout group for the current user.
 

hippy

Technical Support
Staff member
Linux Mint is based on Debian (Ubuntu) so there should be fewer issues than there may be with non-Debian distros.

Being Debian-based, 'groups' and 'id' commands should show which groups the logged in user belongs to.

Looking at my notes I have tested Linux Mint 18 Cinnamon 32-bit and installing the AXE027 apparently did work for me following the instructions you used in post #1 as there are no problems noted.

Which version of Linux Mint are you using, 32-bit or 64-bit, are you running it from a Live DVD or is it a hard disk installation ?
 

GAP

Senior Member
Linux Mint is based on Debian (Ubuntu) so there should be fewer issues than there may be with non-Debian distros.

Being Debian-based, 'groups' and 'id' commands should show which groups the logged in user belongs to.

Looking at my notes I have tested Linux Mint 18 Cinnamon 32-bit and installing the AXE027 apparently did work for me following the instructions you used in post #1 as there are no problems noted.

Which version of Linux Mint are you using, 32-bit or 64-bit, are you running it from a Live DVD or is it a hard disk installation ?
I am using Linux Mint 17.1 Rebecca 32-bit, running from a hard disc installation (machine is over 15 years old)

I will try Jeremy's suggestion when I get to have a play with the old machine.
 

GAP

Senior Member
If dmesg isn't showing the USB port for the AXE027, then that suggests that the ftdi driver hasn't installed for some reason. It doesn't seem to be a dialout user group permissions problem, AFAICS, that is a later thing, done once the USB serial port driver is loaded and has been allocated.

If you use this command from the terminal:

Code:
dmesg | grep FTDI
then it should return some strings detailing the FTDi driver as being installed correctly and giving the new USB serial port designation (probably something like ttyUSB0). It is the latter port designation that needs to be added to the dialout group for the current user.

Inserted dmesg | grep FTDI into terminal and there were no returns just back to "command prompt"

Went back to picaxe axe027 site and entered the second lot of instructions (for older versions) into terminal then ran dmesg | grep FTDI.

Got this in return
graeme@graeme-PY067AA-ABG-SR1520AN-AN530 ~ $ dmesg | grep FTDI
[10868.835052] usbserial: USB Serial support registered for FTDI USB Serial Device
with FTDI highlighted in red.
 
Last edited:

steliosm

Senior Member
OK, so it seems you have the drivers available. Using: dmesg | grep USB should point out what is the serial port name used for this device (axe027).

This is what I get when I plug my USB-Serial cable, which is not an axe027 but is has the same FTDI chipset:
Code:
[  153.186210] usb 5-4: new full-speed USB device number 4 using ohci-pci
[  153.353002] usb 5-4: New USB device found, idVendor=0403, idProduct=6001
[  153.353010] usb 5-4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[  153.353015] usb 5-4: Product: USB <-> Serial
[  153.353019] usb 5-4: Manufacturer: FTDI
[  153.357066] ftdi_sio 5-4:1.0: FTDI USB Serial Device converter detected
[  153.357122] usb 5-4: Detected FT232BM
[  153.357127] usb 5-4: Number of endpoints 2
[  153.357131] usb 5-4: Endpoint 1 MaxPacketSize 64
[  153.357135] usb 5-4: Endpoint 2 MaxPacketSize 64
[  153.357139] usb 5-4: Setting MaxPacketSize 64
[  153.361140] usb 5-4: FTDI USB Serial Device converter now attached to ttyUSB0
renos@narnia:~$
You can see that the serial port assigned in /dev/ttyUSB0
 

hippy

Technical Support
Staff member
Went back to picaxe axe027 site and entered the second lot of instructions (for older versions) into terminal then ran dmesg | grep FTDI.

Got this in return
graeme@graeme-PY067AA-ABG-SR1520AN-AN530 ~ $ dmesg | grep FTDI
[10868.835052] usbserial: USB Serial support registered for FTDI USB Serial Device
So is it working now, does /dev/ttyUSB0 exist with the cable plugged-in ?
 

Janne

Senior Member
I had similar problems surfacing every time I switched to a more recent linux distribution, the way to patch / modprobe etc the FTDI drivers were always changing. After struggling for the nth time, I figured out that if I change the PID of the axe027 cable to match that of a "regular" FTDI usb / uart chip the driver installation would work automatically without problems.

Instructions ow to go about the change are plentiful thanks to a windows driver version which reverted the VID / PID numbers of the counterfeit chips unusable..
 

kfjl

Member
If you have a Windows machine handy, try installing the cable on that.
If it doesn't work with Windows either, you might have a faulty cable.
If it does work with Windows, use the AXE027-Programming-Tool to change the PID to 6001. It should then work with Linux.
Tried and tested this morning on Linux Mint 18.1 Cinnamon (Ver 3.2.7) 32-bit. Noyau Linux 4.4.0-93-generic.
Also works with:

4.12.3-1-ARCH x86_64
Q4OS-desktop 3.16.0-4-amd64
 
Last edited:

GAP

Senior Member
If you have a Windows machine handy, try installing the cable on that.
If it doesn't work with Windows either, you might have a faulty cable.
If it does work with Windows, use the AXE027-Programming-Tool to change the PID to 6001. It should then work with Linux.
Tried and tested this morning on Linux Mint 18.1 Cinnamon (Ver 3.2.7) 32-bit. Noyau Linux 4.4.0-93-generic.
Also works with:

4.12.3-1-ARCH x86_64
Q4OS-desktop 3.16.0-4-amd64
Cable works on Windows no problem has for over 4 years now.

This could be a major source of the issue basically my not understanding the instructions due to lack of experience.

From the axe027 page On Linux the default (preinstalled) ftdi_sio driver only recognises the default FTDI PID, which is 6001. However the user can use 'modprobe' to set the driver to recognise the AXE027 PID (bd90).
Therefore Linux users can choose either to simply use a 'modprobe' command or to reprogram the cable to set the PID to 6001.


So this is not correct?
sudo echo "0403 bd90" > /sys/bus/usb-serial/drivers/ftdi_sio/new_id

It should be?
sudo echo "0403 6001" > /sys/bus/usb-serial/drivers/ftdi_sio/new_id

Will it work on 17.1 Rebecca?
 
Last edited:

kfjl

Member
I've installed Axepad and the programming cable on all sorts of Linux distributions and every time it has been a pain in the *rse. If you want to do it the hard way, I'll leave you to it.

Follow Janne's advice and Hippy's link.

CHANGE THE PID.

Over and out.
 

hippy

Technical Support
Staff member
So this is not correct?
sudo echo "0403 bd90" > /sys/bus/usb-serial/drivers/ftdi_sio/new_id

It should be?
sudo echo "0403 6001"[/B] > /sys/bus/usb-serial/drivers/ftdi_sio/new_id
The instructions in the guide are correct.

You should sudo echo "0403 bd90" if trying to configure the Linux PC to use an AXE027.

Using sudo echo "0403 6001" would be trying to configure the Linux PC to use a standard FTDI cable which is not usually necessary because Linux should be preconfigured to recognise standard FTDI cables.

Will it work on 17.1 Rebecca?
I do not know. My notes indicate it does work with Linux Mint 18 Cinnamon 32-bit.
 
Last edited:

hippy

Technical Support
Staff member
Linux should be preconfigured to recognise FTDI cables.
But not Rev Ed's.
I have changed that to "Linux should be preconfigured to recognise standard FTDI cables", those with VID=0403 PID=6001 and a few others -

https://github.com/torvalds/linux/blob/master/drivers/usb/serial/ftdi_sio_ids.h

But, no, not the AXE027. I will suggest we see what can be done in having the AXE027 added to that list, and then, perhaps one day, it won't be so much of a problem.

I've installed Axepad and the programming cable on all sorts of Linux distributions and every time it has been a pain in the *rse.
It can be a real pain. It is one of the reasons why there is such reluctance for some companies to support Linux and there can be considerable difficulties, frustrations and costs if one attempts to.

Linux often seems to be built on shifting sands, with numerous distros all slightly different, with major differences when developers change how things work with little regard to backwards compatibility or the consequences of such changes. What worked yesterday, and perhaps has done for years, may not work today, instructions which work on systems tested don't always work on others.

PC operating systems derived from Debian Jessie which we have tested our AXE027 instructions with and have been found to work include -

* Ubuntu Desktop 14.04
* Ubuntu Desktop 16.04
* Ubuntu MATE 16.04
* Linux Mint 18 (Cinnamon)
* Raspberry Pi PIXEL OS for X86 PC 1.1 (2016 beta)

And it also works with Raspbian Jessie on the Raspberry Pi. I booted a Raspbian Jessie I had previously issued the instructions on and it recognised the AXE027, created /dev/ttyUSB0. All as expected.

I was having a problem with Raspbian Stretch but that seems to have been self-inflicted user error. Will update when I know for sure.
 
Last edited:

GAP

Senior Member
This from the "USB Help" in options in axepad.

4.2) Linux Patch Option 2 (recommended)
Create a new udev rule, so that the modprobe rule is automatically applied every time the computer boots.
Create a new file (e.g. using KWrite, gedit or similar text editor) named
/etc/udev/rules.d/99-axe027.rules
To do this press open a Terminal console and then type
sudo kwrite /etc/udev/rules.d/99-axe027.rules
Then enter the following text (note the last 2 lines below should be entered as one long line) and then save the file.
# /etc/udev/rules.d/99-axe027.rules
# contains axe027 udev rule to patch default
# FTDI product id to AXE027 product id (0xbd90)
SYSFS{idProduct}=="bd90",
SYSFS{idVendor}=="0403",
RUN+="/sbin/modprobe -q ftdi_sio product=0xbd90 vendor=0x0403"
The new rule will then always be applied when the system boots. To immediately try out the new rule without
rebooting open a Terminal console and then type
sudo udevcontrol reload_rules

This is what i get following the instructions
Screenshot when USB help followed.png
 

kfjl

Member
Hello again, GAP.

When you get the "Download Failed" error, type: ls /dev in the terminal. You might have had a "ttyUSB0" but you didn't have the "ttyUSB1" Axepad was looking for. You can change the usb port to suit the ttyUSB(n) file in Axepad>Options>Port. Be aware that the USB port number can change each time you unplug and replug the cable.

The second error was because you did NOT follow the instructions. You have to create a file called /etc/udev/rules.d/99-axe027.rules and put the "SYSFS" and "RUN" lines in it. Just typing "SYSFS" etc in the terminal won't do it.

What you're trying to do is like digging a tunnel to your local pub when you can walk it in five minutes. You'll get there in the end...

I was a lot slower off the mark than Janne. The penny finally dropped when my home-made download cables worked out-of-the-box in a freshly-installed Mint distribution but the axe027 cable didn't. The problem is with the cable's PID. Once changed to 6001 the Axe027 also worked out-of-the-box.

The instructions you're following can probably be considered obsolete. The programming tool does the job. That shouldn't be necessary either if Hippy can get the Axe027 PID included in the ftdi_sio module.

You're a handfull of clicks away from a working cable.

Stop digging.
 

GAP

Senior Member
I created a file called /etc/udev/rules.d/99-axe027.rules and put the "SYSFS" and "RUN" lines in it using gedit and I think I saved it.

I changed the USB1 to USB0 in the axepad options and when I tried to download a program I got a message asking me to "connect power".

Checked my batteries and they were only at 3.7V not the usual 4.8V.

A screenshot of what I get at least there is writing in the window that was not there before.

Screenshot axepad download.png

Hopefully I can put the shovel down.
 

GAP

Senior Member
Batteries charged no change.

I could not save the /etc/udev/rules.d/99-axe027.rules file as I do not have the permissions to save it.

I have no idea what I am doing with this.

Starting to think is just a bad idea that will never work.
 

hippy

Technical Support
Staff member
I could not save the /etc/udev/rules.d/99-axe027.rules file as I do not have the permissions to save it.
Because the directory the file you are creating belongs to the "root" user you have to prefix the "sudo" command to however you are creating the file. For example, if using the "kwrite" editor to create the file ...

sudo kwrite /etc/udev/rules.d/99-axe027.rules

This is how it is shown in the AXE027 manual.
 

GAP

Senior Member
Decided to give Linux the flick with regard to picaxe.
As I have a dual boot machine I installed PE 6 in WIN XP but now the AXE 027 cannot be seen by it.
The AXE 027 is on COM 3 but PE cannot find any hardware on COM 3. I tried to follow the COM port instruction but they appear to be from an earlier version.
Is it possible that I have trashed my AXE 027 while mucking around with Linux and changed the number on it?
If so is there a factory reset option or do I just save up and buy a new one?
I have done the
 

hippy

Technical Support
Staff member
If the AXE027 is appearing as COM3 then it appears the AXE027 is working as Windows has been able to identify it. How is the COM3 named in the list which is shown when you click on Configure and Test in the COM Port section of Workplace Explorer ?

"Hardware not found" usually indicates the cable is working but the PICAXE hardware needs a hard Reset.
 

GAP

Senior Member
If the AXE027 is appearing as COM3 then it appears the AXE027 is working as Windows has been able to identify it. How is the COM3 named in the list which is shown when you click on Configure and Test in the COM Port section of Workplace Explorer ?

"Hardware not found" usually indicates the cable is working but the PICAXE hardware needs a hard Reset.

Found the fault with the hardware, the ON/OFF switch had developed an open circuit so even though I thought it was on it was really off.

Now works with XP but still not with Linux, still the same error as post #22, which is a shame as I quite like Linux on this old machine.

XP will get me out for the time being but it is not practical to have to switch between OS to work on a project.
 

hippy

Technical Support
Staff member
still the same error as post #22
The issue with post #22, as 'kfjl' notes, is that you typed stuff which should have been placed in a file was typed at the command line as if commands.
 

GAP

Senior Member
The issue with post #22, as 'kfjl' notes, is that you typed stuff which should have been placed in a file was typed at the command line as if commands.
And that problem stems from me not knowing how to use Linux Mint. Unfortunately you are dealing with a complete computer newbie.
 

kfjl

Member
The problem stems from your insistence on doing it the hard way when, as you readily admit, you only have a teaspoon to dig with.

That being said, changing the cable's product ID doesn't guarantee it will work without some messing with file permissions, as I've just found out using someone else's Arch Linux laptop.

However, Arch Linux is mainly intended for masochists, so you should get away with just changing the cable's PID to 6001 with Mint 17, as I did with Mint 18.
 

hippy

Technical Support
Staff member
And you could upgrade to Mint 18 which we have tested and know that worked with an unaltered AXE027.
 

GAP

Senior Member
Did you go back to attempting to create the udev rules properly ?
When I put this into terminal "sudo modprobe ftdi_sio"
I get this error "modprobe: ERROR: could not insert 'ftdi_sio': Exec format error"

It now is becoming apparent that I will most probably never get axe027 to run on Linux.
 

JeremyB

New Member
GAP, are you the user posting on the Linux Mint forums? I think you might be trying to use the module I compiled for the 3.13 kernel in LM 18 and that will result with the exec format error
 

GAP

Senior Member
GAP, are you the user posting on the Linux Mint forums? I think you might be trying to use the module I compiled for the 3.13 kernel in LM 18 and that will result with the exec format error
Yes that's me I'm trying both to see if I can get suggestions from both sides of the problem that can help.
 
Top