Using CAN-Do under Ubuntu and MacOS

My Nissan Leaf Forum

Help Support My Nissan Leaf Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

garygid

Well-known member
Joined
Apr 21, 2010
Messages
12,469
Location
Laguna Hills, Orange Co, CA
CAN-Do can be run under Ubuntu or MacOS, using Wine (Windows Emulator).

I had to copy three (edit, 4 neeeded) Visual Basic 6 routines
into the folder containing CAN-Do and the Recipe file:

MSVBVM60. DLL
MSCOMM32. OCX
COMDLG32. OCX
MSCOMCTL.OCX (needed for the CAN-Do Dashboard screen)

I will add these to a new Ubuntu section on my CAN-Do web page:
http://www.wwwsite.com/puzzles/cando/" onclick="window.open(this.href);return false;
(done June 2014)
(the MSCOMCTL.OCX file added 15 July 2014)

I have not yet tried using the Comm Ports to capture the Log data
(when running under Ubuntu or MacOS),
but the program itself runs, Reads a Log file, shows the Recipes,
and graphs some of the CAN Message variables.

Edit: June 2014: I just tried Ubuntu 14.04 and Wine 1.6.2, on a AMD64
laptop, and it seemed to run there also... see the posts below.

Edit: 15 July 2014: JeremyW tried MacOS 10.9 and WINE and managed
to run CAN-DO successfully - See his post on page two.
 
Versions, Sources, and Steps

Versions:
CAN-Do 1.8.4
Ubuntu (latest)
Wine 1.4 (as I recall, I will check)

Sources:


Steps:
1. Not wanting to install Ubuntu on my Windows PC,
I downloaded an "iso" file to create a bootable CD.
From the CD, one can run Ubuntu in RAM, or install it.

2. For a more portable Ubuntu, I followed their instructions
for creating a bootable USB Flash Drive. Running this version,
I could install Wine on the Flash Drive.

3....
 
garygid said:
Versions, Sources, and Steps

Versions:
CAN-Do 1.8.4
Ubuntu (latest)
Wine 1.4 (as I recall, I will check)

....
I can confirm that it runs under Wine 1.4 (current stable version).
I don't know how it operates with serial input; I don't have a Soc-meter yet.

More information about Wine: http://www.winehq.org/" onclick="window.open(this.href);return false;

There is also a distribution for the Mac.
Perhaps Mac users can try that?
 
Does anybody have more details on using Wine to run CAN-Do
under Ubuntu, or perhaps under freeBSD?

Would it work when running from Ubuntu from a USB flash drive?

Thanks, Gary
 
I am in the process of trying to modify my 500 GB laptop Hard Drive with Win7
to triple boot to both Ubuntu and freeBSD, to test CAN-Do using Wine under
these Linux operating systems.

This is to support the efforts to investigate the CAN buses on the Tesla S.

Following the instructions here:
http://lifehacker.com/5403100/dual-boot-windows-7-and-ubuntu-in-perfect-harmony" onclick="window.open(this.href);return false;

I have ...
1. "shrunk" the Win7 450 GB partition to 250 GB

Seems to work, but Avast seems unable to update, so an uninstall
and re-install of Avast might be the next step.

Then I plan to...
2. create a 25 GB partition for Ubuntu, install, and see it it will dual boot.

Knowing exactly what versions of Wine and Ubuntu were used to
successfully run CAN-Do would be quite helpful.
Other suggestions welcome.

Thanks
 
Progress...
1. An uninstall of Avast would not work, but removing Avast with
Avast's "cleaner" did remove it. A fresh install of the free Avast
program worked, and now Avast seems to be working normally.

2. Made a DVD of Ubuntu ver 14.04 and ran Gparted to create a
25 GB primary partion for booting an installed Ubuntu. Installing Ubuntu
into that primary partition had some glitches, but eventually
seemed to work, but rather slowly (with no Swap File or Swap Partition).

However, the laptop now dual boots to both Win7 and Ubuntu.
More experiments later today, I hope.
 
Gary -

Why not run a virtual machine instead of dual/triple booting?

VirtualBox is open source and allows you to create VMs. VMware player (free) allows you to play VM's, including those created by VirtualBox, but not create them. VMware Workstation (a couple hundred dollars) allows you to create VM's and play them.

VM's are a whole lot cleaner then a multiple OS install - and much easier to maintain.
 
For me, with only a Win7 laptop, I wanted to preserve the Win7,
and have a native Ubuntu (ver 14.04 - AMD64 .iso file) that I could
boot from a DVD, or install.

I wanted to test the WINE 1.6.2 that is included with Ubuntu 14.04
to see if the other Linux users could run my CAN-Do program
successfully.
 
SUCCESS!!!!!

I installed Ubuntu 14.04 from a DVD burned from the AMD64 iso file,
and installed it into a 25 GB primary partition on my hard drive.
My laptop is a 64 bit machine, with an AMD dual core processor.
The Ubuntu installer created the dual-boot (apparently in the 100 MB
partition before the Windows partition), automatically recognizing
the installed Win7 OS.

Booting into Ubuntu, I installed the included WINE, which turned out to be
ver 1.6.2 rather than the latest 1.7.x version. I tried to run it, but nothing
appeared, apparently because I supplied no arguments.
Try
wine --help
or
wine --version
or
man wine

I use the provided Firefox browser to download 4 zip files from
http://www.wwwsite.com/puzzles/cando/" onclick="window.open(this.href);return false;
1. My CAN-Do ver 221 executable (.exe) file.
2. The support files (2 ocx, 1 dll) in one CANDO-Ubuntu zip file
3. Recipe file version 1.05, which has some guesses at the Tesla S messages.
4. A Log file from a 6-hour LEAF charging (L2) session.
(There are no Tesla logs online, yet.)

I right-clicked each zip file and clicked Extract Here.
With the resulting 6 files all in the same folder, I just double-clicked
the ".exe" file. WINE was automaticly started, it started CAN-Do, which
then wrote a default INI file (since I had not included one in the folder),
and "surprise", the CAN-Do Main Screen appeared. Oh, great Nerd-Joy.

I tried reading the Log file using the Input Screen, listing the MsgIDs on
the Main Screen, and graphing some of the LEAF EV-CAN Recipe items
in different colors. It just worked, with no apparent problems.

Although I have not yet tried to capture Log data from a virtual
serial comm port (via a USB port), with CAN-Do, I encourage
other Linux users to try using WINE to run my CAN-Do program,
and become familiar with using CAN-Do to explore the logs
that come from the LEAF, iMiev, Tesla S, and Rav4EV.

Please report your results here.

More later, Gary
 
Since I cannot triple boot this Win 7 laptop,
I will try to make a USB Flash Drive of freeBSD and see if I can
run on a 32 bit PC from that, and see if WINE is included.

If it is, maybe I can find a way to write CAN-Do to the
USB drive, and run it there.

More Later, Gary
 
I'm happy to report that this program does indeed run on MacOS 10.9 under wine.

1.) Install macports
2.) Install wine (takes forever!) (from a command line: sudo port install wine)
3.) Put the "ubuntu" files, CAN-Do exe file, and recipe file in one directory
4.) From a command line inside your directory with the files: wine CAN-Do-v221.exe

You may have to ctrl-z the first run, then re-run the exe.

Looks like the dashboard crashes though, with an error message of:
Run-time error '339':
Component 'MSCOMCTL.OCX' or one of its dependencies not correctly registered: a file is missing or invalid
 
Thanks Jeremy,
I will add that ocx file to the other "Ubuntu" files, and note here
when I have done that addition.

Edit: On my http://www.wwwsite.com/puzzles/cando/" onclick="window.open(this.href);return false; web page:
MSCOMCTL.OCX (as mscomctl.ocx) is now in ver 2 of the "Ubuntu and MacOS"
zip file, along with the other 3 file that are in the ver 1 zip file just above.

Add the mscomctl.ocx to the CAN-Do program folder, and then
see if the Dashboard Screen works in LEAF mode. Most likely,
both Ubuntu and MacOS need this file to display the Dashboard.

At the moment, in CAN-Do version 221, the other dashboard
modes, like Tesla S and Rav4EV, are mostly copies of the LEAF
dashboard, and have not been tested with real data.
 
Other less-used screens of CAN-Do might require
other files, MSCHRT20.OCX (used by ?? in CAN-Do) or ...
Please let me know what you find as you explore CAN-Do.
This file is now in the ver 3 of the "Ubuntu and MacOS" zip file.

In particular, using Virtual COMM ports to actually receive the
fairly fast (115.2 kbaud, or higher) CAN data and hold that data
in memory (then you write it later to an appropriate Log file),
has only been done with a fairly fast PC laptop ...
at least by me using my Windows Vista here.

If you try receiving CAN data, usually from an AVR-CAN
development board at 115.2 kbaud using our firmware,
please post details of your experience here.

The files captured by the "Canary" were, last I looked,
compatible with CAN-Do, though they might have been
missing something like an initial Date-Time message.
 
NOTE:
The official MSCOMM32.OCX file only supports COMM Port
numbers 1 through 15 (or 16?), and the OCX file that I use
has been patched (one byte) to support more port numbers,
perhaps up to 99 (I do not remember exactly).

The High Speed 4-port Serial to USB Adapter that I use
(from http://www.easysync-ltd.com/product/534/usb2-h-1004.html" onclick="window.open(this.href);return false; )
seems to work very well, but often assigns higher port numbers.
However, you can usually change or assign the port numbers
to make your system work, even with the Official OCX program.

I bought and have tried many serial to USB cables that did
not work well at the 115.2 kbaud speed. They would pass
most of the data, but occasionally lose some bytes,
with no warning. However, in CAN-Do I can look at the
data bytes in the CAN Messages that carry less than
the full 8 bytes of data (that our AVR-CAN program
carefully forces to 0xFF values) and detect some of
these bytes being non-FF, meaning that the data
stream is corrupted in some way.

If bytes are lost, the CAN-Do input parser, in watching
for the Sync-Value byte (that is added to each Message
by our AVR-CAN firmware), slides through the input data
watching for another Sync-Up to occur, and CAN-Do is set
by default to display the number of Errors (including
Sync-Errors) that occured during a COMM input session.
 
I use a CANary for logging and do not need the AVR/serial functions and also cannot test them. I was getting some serial errors or warnings on the terminal display while the program was running.

Code:
fixme:file:get_default_com_device no known default for device com9
fixme:file:get_default_com_device no known default for device com8
fixme:file:get_default_com_device no known default for device com7
fixme:ole:RemUnknown_QueryInterface No interface for iid {00000019-0000-0000-c000-000000000046}
fixme:file:get_default_com_device no known default for device com9
fixme:file:get_default_com_device no known default for device com8
fixme:file:get_default_com_device no known default for device com7
err:ole:CoGetClassObject class {35053a22-8589-11d1-b16a-00c0f0283628} not registered
err:ole:CoGetClassObject class {35053a22-8589-11d1-b16a-00c0f0283628} not registered
err:ole:CoGetClassObject no class object {35053a22-8589-11d1-b16a-00c0f0283628} could be created for context 0x3
err:ole:CoGetClassObject class {35053a22-8589-11d1-b16a-00c0f0283628} not registered
err:ole:CoGetClassObject class {35053a22-8589-11d1-b16a-00c0f0283628} not registered
err:ole:CoGetClassObject no class object {35053a22-8589-11d1-b16a-00c0f0283628} could be created for context 0x3
 
Back
Top