Successfully running PE5 under Linux/Wine

geoff07

Senior Member
This is a summary of what I had to do to get this to work, reported here to capture it and perhaps make life a bit easier for others. It is a follow-on from discussion (OT) in another thread. Though PE5 is 'obsolete' it still works well in most cases and is far lighter than the PE6 IDE. So it is better suited to use by children (I have used it with 10-year olds) and is also easier to use on small computers, which I like to use. PE6 has its place, but not in those situations in my view.

There seem to be two principal problems to solve with PE5 under Wine/Linux:

- The missing MFC40.dll / wave32.ocx file

- the failure of the AXE027 to generate a /dev/ttyUSB0 device for use in a symlink

There is also a third problem, viz. much of the advice on the internet is out of date and does not work. The solution described here does work on Ubuntu 16.04 and almost certainly on any Linux as there are no linux changes involved.

Considerable credit goes to FTDI Limited for some really prompt and helpful support today that got me pointed at the USB solution, albeit after a few false starts. And to Rev-Ed, for producing the actual solution, though it took FTDI to help me find it.

The missing file problem

The MFC40.dll/wave32.ocx problem is one and the same. It reports as a wave32.ocx issue, but is solved by the MFC.dll file. The fix is

- obtain a copy of MFC40.dll. ideally from a Windows distribution disk (so it is clean)

- place this file in ~/.wine/Drive_C/windows, and ~/.wine/Drive_C/windows/system Only one of these is necessary, probably system, but I don't know which and the file is small so it doesn't matter. The advice I found was to put it in /system32 - this did NOT work.

The missing /dev/ttyUSB0 problem

It is not that the axe027 was not recognised by linux - after all I had been using it for years under XP under virtualbox. The problem was the non-creation of the /dev/ttyUSB0 device, needed for the symlink to PE5.

This is more tricky. The problem is that the FTDI driver for linux only knows about a limited number of oem versions of the ftdi chip. It does not know about the AXE027 version. The only difference is the product ID code 'PID' of bd90, set by Rev-Ed under FTDI advice.

There are two choices: amend the linux driver to know about PID=bd90, or change the AXE027 PID in eeprom to be one that the driver does know (6001)

I first tried all the published methods of updating the driver that I could find (I drew the line at recompiling the linux kernel) including material in FTDI Technical Notes TN-101, 106, and AN-220. None of these methods worked, including that published by Rev-Ed in their AXE027 installation instructions, due to 2013 changes to the linux kernel. Then I discovered that I could in fact use the second approach. Thanks to FTDI I discovered that Rev-Ed had in fact provided the means to make this change, and that making it did not affect the functionality of the cable. The instructions about this are here:

http://www.picaxe.com/AXE027-Programming-Tool/

The downside is it needs a Windows machine to run, but despite my lack of enthusiasm for the supplier, I do have a real machine.

This works! And is actually quite simple. Which was a considerable relief, as other methods had involved patching the kernel, creating udev rules, writing C code to edit the ftdi_sio driver source and then recompile. All a bit much when all you want to do is plug in a cable, especially when after all the effort they don't work.

It involved a) installing a driver, and b) running a simple app that changes the code, all provided.

When this is done and the cable is amended, run this command:

ln -s /dev/ttyUSB0 ~/.wine/dosdevices/com1 to make the symlink so that wine can see the USB cable. It will make a visible entry in the dosdevices directory.

Your axe027 cable is now a generic ftdi usb/serial converter. If you need, the same app will convert it back to an axe027. Setserial -a /dev/ttyUSB0 or dmesg | grep USB will confirm its presence.

The PE5 installed in Wine will now find the cable on com1 (you won't see it listed as an AXE027, just try the PE5/options/check firmware version button.)
 

Technical

Technical Support
Staff member
Your axe027 cable is now a generic ftdi usb/serial converter.
Not quite. It now has the generic FTDI 6001 PID, but still has all the other custom AXE027 settings that are required e.g. inverted polarity.
 

geoff07

Senior Member
Of course. I should have said 'to linux it is ..".

After considerable frustration it was great to come across your little app, which, like the rest of Picaxe, 'just works'!
 

Jeremy Harris

Senior Member
Is the forum still on Summer Time? I just noticed the times of posts.
Have you checked your setings, here? There is an option to automatically detect DST and that could be the cause.

Edited to add: No, it's not that, I just checked with this post. The forum clock is out for some reason.
 
Top