AXE027 PICAXE USB Download Cable - ID 0403:bd90

For drivers and kernel modules.
Post Reply
Message
Author
User avatar
rerwin
Posts: 2017
Joined: Wed 24 Aug 2005, 22:50
Location: Maine, USA

AXE027 PICAXE USB Download Cable - ID 0403:bd90

#1 Post by rerwin »

In response to the request by bh56/Brandon in the tahrpup Project thread, I built a pet package to support the USB Download Cable for PICAXE microcontrollers.

As background, here are quotes from the PICAXE site,
http://www.picaxe.com/
What Is PICAXE?

A PICAXE microcontroller is designed to be the brain of your electronic project. Originally designed as an educational system for schools, the PICAXE system has now also been widely adopted by hundreds of thousands of 'hobbyists' due to its ease of use. Each year thousands of high school students are also introduced to electronics and microcontrollers via building a PICAXE project.

PICAXE chips are popular because they are very low-cost, and simple to program using free, easy-to-learn software.

The PICAXE chip can react to input sensors and switch outputs on and off accordingly.
A USB download cable is an essential purchase to use the PICAXE system.
Basically, the download cable contains an USB to Serial chip made by FTDI for which a linux kernel module already exists! The problem is that the module is not recognized automatically bec[a]use the cable ha[s] different[,] non-standard identificatives.
Although another up-to-date implementation is presented at:
http://askubuntu.com/questions/525016/c ... ev-ttyusb0
it bypasses the Puppy way of loading modules. My solution uses a udev rule and a modprobe configuration install statement.

/etc/udev/rules.d/99-axe027.rules:

Code: Select all

ACTION=="add", SUBSYSTEM=="usb", \
   ATTRS{idVendor}=="0403", ATTRS{idProduct}=="bd90", \
   RUN+="/sbin/pup_event_backend_modprobe axe027"
/etc/modprobe.d/axe027.conf

Code: Select all

install axe027 \
 /sbin/modprobe --first-time --ignore-install ftdi_sio \
  && echo 0403 bd90 > /sys/bus/usb-serial/drivers/ftdi_sio/new_id
To use the install statement in another linux, change the string, "/sbin/pup_event_backend_modprobe" to simply "/sbin/modprobe"

In addition to automatic loading of the driver at bootup, this implementation supports use of the console command, "modprobe axe027".

Thanks, Brandon, for calling attention to the need for Puppy to support the fascinating PICAXE projects and for testing my code.
Richard

UPDATE 3/17/2015:
Uploaded an enhanced version of the package that (1) supports removal (modprobe -r axe027) of the driver and (2) prevents its loading if another device is already using the ftdi_sio driver, so as to avoid disrupting that device. It also avoids removal if the ftdi_sio driver is in use by another device. This enhancement should allow it to reside safely within a distro, as well as be installable by users.
Attachments
axe027-noarch-20150317.pet
Pseudo driver for AXE027 PICAXE USB Download Cable
Expanded to avoid driver conflict with other similar (FTDI) devices
Rule file supports both Puppy and other linux distros (without being edited).
(1.25 KiB) Downloaded 483 times
axe027-noarch-20150312.pet
Pseudo driver for AXE027 PICAXE USB Download Cable
(818 Bytes) Downloaded 502 times
Last edited by rerwin on Wed 18 Mar 2015, 01:43, edited 4 times in total.

starhawk
Posts: 4906
Joined: Mon 22 Nov 2010, 06:04
Location: Everybody knows this is nowhere...

#2 Post by starhawk »

Nice :D

If I wanted to use this in Carolina Vanguard, what changes (if any) would I have to make to the dotPET?

User avatar
rerwin
Posts: 2017
Joined: Wed 24 Aug 2005, 22:50
Location: Maine, USA

#3 Post by rerwin »

starhawk,
It should work in any puppy. It uses only a standard technique and a standard USB driver, ftdi_sio..
R

starhawk
Posts: 4906
Joined: Mon 22 Nov 2010, 06:04
Location: Everybody knows this is nowhere...

#4 Post by starhawk »

Great!

I love PICAXE :D so easy to use...

User avatar
rerwin
Posts: 2017
Joined: Wed 24 Aug 2005, 22:50
Location: Maine, USA

Pseudo-driver files for use in non-Puppy linux distros

#5 Post by rerwin »

For anyone wanting this pseudo-driver outside of the Puppy world, I attach the rules and conf files individually, for the user to place in the appropriate directories.
  • axe027.conf should go into /usr/modprobe.d.

    axe027.rules should probably go to either /etc/udev/rules.d for user installation or /lib/udev/rules.d for inclusion in a distro.
The files are those constituting the "enhanced" Puppy package in the main posting, above. For Puppy installations, please use that pet package instead of these files.
Attachments
axe027.conf.gz
Zipped configuration file to reside in /etc/modprobe.d
(531 Bytes) Downloaded 483 times
99-axe027.rules.gz
Zipped rule file to reside in /etc/udev/rules.d or /lib/udev/rules.d
(303 Bytes) Downloaded 466 times

User avatar
rerwin
Posts: 2017
Joined: Wed 24 Aug 2005, 22:50
Location: Maine, USA

Some details about the "enhanced" pseudo-driver

#6 Post by rerwin »

The enhancements are the detection of the ftdi_sio driver already loaded for another USB device, to avoid corrupting its operation, and the prevention of unloading ftdi_sio if it is in use by another device.

As with any driver, no messages are issued if loading is successful or redundant. With axe027, if another device is already using ftdi_sio, this type of message will appear in the system log, /var/log/messages:

Code: Select all

Mar 20 00:11:20 puppypc25427 daemon.err kernel: udevd[3104]: '/sbin/pup_event_backend_modprobe ftdi_sio' [4453] terminated by signal 15 (Terminated)
This is the only indication of a conflict detected during bootup, triggered by the rule file. However, when the modprobe command is used to start or remove the pseudo-driver (axe027) additional messages are generated (to syserr):

Code: Select all

modprobe axe027: module ftdi_sio not inserted -- used by hardware ID vvvv:pppp

modprobe axe027: module ftdi_sio not inserted -- used by another USB device

modprobe axe027: module ftdi_sio not removed -- used by hardware ID vvvv:pppp

modprobe axe027: module ftdi_sio not removed -- used by another USB device

modprobe axe027: module ftdi_sio not found
The messages with the hardware ID are sent only if the ID is available, otherwise the "another USB device" versions are sent.

Post Reply