Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Fri 24 Nov 2017, 09:25
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Drivers
AXE027 PICAXE USB Download Cable - ID 0403:bd90
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [6 Posts]  
Author Message
rerwin


Joined: 24 Aug 2005
Posts: 1845
Location: Maine, USA

PostPosted: Thu 12 Mar 2015, 21:11    Post subject:  AXE027 PICAXE USB Download Cable - ID 0403:bd90
Subject description: Pseudo driver for connection to PICAXE microcontrollers
 

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/
Quote:
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.
Quote:
A USB download cable is an essential purchase to use the PICAXE system.
Quote:
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/cant-open-port-dev-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:
ACTION=="add", SUBSYSTEM=="usb", \
   ATTRS{idVendor}=="0403", ATTRS{idProduct}=="bd90", \
   RUN+="/sbin/pup_event_backend_modprobe axe027"

/etc/modprobe.d/axe027.conf
Code:
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.
axe027-noarch-20150317.pet
Description  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).
pet

 Download 
Filename  axe027-noarch-20150317.pet 
Filesize  1.25 KB 
Downloaded  269 Time(s) 
axe027-noarch-20150312.pet
Description  Pseudo driver for AXE027 PICAXE USB Download Cable
pet

 Download 
Filename  axe027-noarch-20150312.pet 
Filesize  818 Bytes 
Downloaded  282 Time(s) 

Last edited by rerwin on Tue 17 Mar 2015, 21:43; edited 4 times in total
Back to top
View user's profile Send private message 
starhawk

Joined: 22 Nov 2010
Posts: 5056
Location: Everybody knows this is nowhere...

PostPosted: Thu 12 Mar 2015, 21:18    Post subject:  

Nice Very Happy

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

_________________

Back to top
View user's profile Send private message 
rerwin


Joined: 24 Aug 2005
Posts: 1845
Location: Maine, USA

PostPosted: Thu 12 Mar 2015, 21:41    Post subject:  

starhawk,
It should work in any puppy. It uses only a standard technique and a standard USB driver, ftdi_sio..
R
Back to top
View user's profile Send private message 
starhawk

Joined: 22 Nov 2010
Posts: 5056
Location: Everybody knows this is nowhere...

PostPosted: Thu 12 Mar 2015, 21:43    Post subject:  

Great!

I love PICAXE Very Happy so easy to use...

_________________

Back to top
View user's profile Send private message 
rerwin


Joined: 24 Aug 2005
Posts: 1845
Location: Maine, USA

PostPosted: Fri 20 Mar 2015, 17:26    Post subject: Pseudo-driver files for use in non-Puppy linux distros  

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.
axe027.conf.gz
Description  Zipped configuration file to reside in /etc/modprobe.d
gz

 Download 
Filename  axe027.conf.gz 
Filesize  531 Bytes 
Downloaded  266 Time(s) 
99-axe027.rules.gz
Description  Zipped rule file to reside in /etc/udev/rules.d or /lib/udev/rules.d
gz

 Download 
Filename  99-axe027.rules.gz 
Filesize  303 Bytes 
Downloaded  261 Time(s) 
Back to top
View user's profile Send private message 
rerwin


Joined: 24 Aug 2005
Posts: 1845
Location: Maine, USA

PostPosted: Fri 20 Mar 2015, 17:40    Post subject: Some details about the "enhanced" pseudo-driver  

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:
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:
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.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [6 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Drivers
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1577s ][ Queries: 14 (0.0177s) ][ GZIP on ]