LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-10-2016, 02:47 PM   #1
96300NAZ
LQ Newbie
 
Registered: Feb 2016
Posts: 1

Rep: Reputation: Disabled
Best choice for my programming needs?


Hi,

I'm Marshall and I'm new to Linux programming. I've been a PLC (Allen Bradley, Modicon, GE Fanuc, Schneider Electric, and various other PLCs) and HMI (RSView, FactoryTalk, Wonderware, GE iFix, Trihedral) programmer for 10 years this year. As a hobby I've done some light Arduino and Netduino (The Netduino suits me better because I have some experience in VB) over the last two or so years. Nothing major, just small tinkering projects.

I've used Linux since 2004 when I built my first Gentoo machine. (Back when it took several days to compile from a tarball to a GDE. After that I used Ubuntu and finally settled on Linux Mint for the media support that was native.

There's a little background to my knowledge. I'm a forum aficionado so I understand the concept of "Search noob." However the conundrum is, I don't know what to search for. So if you don't mind, I'll describe what I'm wanting to do and maybe you can point me in the proper research direction.

I've got a car project I've been working on. Full restoration ground up build including an aftermarket ECU. This ECU talks on a CAN bus, which is similar to a device network that I'm fluent in DeviceNET. There are a few things that I would like to do. The manufacturer of the ECU, Haltech, gives a detailed listing of all parameters I'd like to read from the network. I would like to graphically display them. I've seen several interfaces my favorite being "GaugeART" which will do MOST of what I'd like to do, however not all. I would like to create a digital replication of the car's current instrument gauge (Including sweeping gauges, etc.), well as a start. I thought starting with a small platform like the Raspberry Pi would be a sufficient solution. I've even found several canbus interface boards for it. So my question are.

Where do I start? I'm assuming starting with the distro without a GDE. There isn't a need for one. I'd like the OS to boot and then go straight into the graphical gauge application. So the two questions I have are. 1) How do I build a graphical application like that? 2) How do I get the data from the canbus to interface with this graphical interface? 3) More my research but, how do I program the bus to actively filter information and display in a live feed what registers I want to look at, but any help is appreciated on that end.

I do realize this will be a huge learning curve and that I'm not going to be able to click some examples and get this working in a night or a week. I just don't know where to start.

Last edited by 96300NAZ; 02-10-2016 at 02:48 PM.
 
Old 02-11-2016, 04:21 PM   #2
codeguy
Member
 
Registered: Jan 2004
Distribution: Slackware
Posts: 187

Rep: Reputation: 46
Actually, you dont need to decide everything all at once. That would probably be bad, actually. It could force you down the wrong road. Dont be afraid to try a few different things, then pick the one that feels most comfortable. Picking a language is like picking out shoes.

The PI has several languages, Perl, Python, C that would all work fine. I'm a perl person myself, so I'd start there, write a little test app to see if I can collect the data needed and display it. If you find it's to slow to render pretty graphic, you might have to switch to C. Script languages are simple and quick to implement. C/Cpp for performance.

BUT there are many many addon's for both perl and python that are written in C and linked in so you get the simplicity of a script language but the performance of C. For example:
http://search.cpan.org/~chm/OpenGL-0.6704/OpenGL.pod
And python will have the same thing.

1) How do I build a graphical application like that?
You have a few options. I like to run a really simple WM like blackbox, that way I can still run an xterm if needed. There are several very lighweight WM's you can choose from. There is a xwindows start script, usually something like ~/.xinitrc or ~/.Xsession, you just add your app to the bottom.

2) How do I get the data from the canbus
You might google: "open source canbus"
There are probably already projects doing it.

https://en.wikipedia.org/wiki/CAN_bus
Is this the interface you have. I've never heard of it, but there's a lot of info there. Any of that help?

2.5) How do I update the graphical interface?
Depends on your UI. Are you using OpenGL? Qt? Maybe you'd like to write a test app in each to decide what UI API you'd like to use first.

3) how do I program the bus to actively filter information
First work on #2. That'll help answer this question. It could be you cannot filter at the bus level. You pull everything back, but then only display what you are interested in. You can ignore this step for now.
 
Old 02-11-2016, 04:25 PM   #3
codeguy
Member
 
Registered: Jan 2004
Distribution: Slackware
Posts: 187

Rep: Reputation: 46
Here are a bunch of projects that look interesting: http://www.can-wiki.info/doku.php?id...t:cananalyzers
 
Old 02-11-2016, 09:38 PM   #4
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,982

Rep: Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626
1) How do I build a graphical application like that?

At some point you need some way to access screen. It may be that a simple X window would work. http://stackoverflow.com/questions/2...window-manager
It may be possible to create something like they do in Mplayer where it can run stand alone.
Or something like this using GTK http://stackoverflow.com/questions/1...ws-environment
Or you can build a somewhat old gui like you'd find in midnight commander or the old norton apps.

2) How do I get the data from the canbus to interface with this graphical interface?

Your most direct way would be to find a device that has two things. One is a gizmo that connects to the obd port and also has a driver for this gizmo. That should be rather easy (relatively)


3) More my research but, how do I program the bus to actively filter information and display in a live feed what registers I want to look at, but any help is appreciated on that end.

This is where you code for actions. You set timers and various checks. If you built your gui in some IDE then you can generally lock those to screen based on some parameter. The places you can get this data could be directly from ECU and any other smart controller or from live can data.


I'll say that you should look at other open source projects to see the source code for their work. Look at various IDE's that may assist in your application.

"Eclipse is famous for our Java Integrated Development Environment (IDE), but our C/C++ IDE and PHP IDE are pretty cool too. You can easily combine language support and other features into any of our default packages, and the Eclipse Marketplace allows for virtually unlimited customization and extension."
https://eclipse.org/ide/

Last edited by jefro; 02-11-2016 at 09:40 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] I'm xfce and have the choice between kde, gnome and root. Which is the best choice? Gregg Bell Linux - Software 9 05-31-2015 01:37 PM
[SOLVED] Choice of programming solutions for collated document repository catkin Programming 7 02-20-2011 12:10 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:58 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration