-
Your go-to language/dev enviroment for MCU - PC host software
Posted by
Buriedcode
on 11 Apr, 2017 16:31
-
I'm sure this question has been asked many times, often vaguely with 'what PC language do you use?' but I will try to make this more specific.
A long time ago when I found out how cool it is to be able to hook an MCU to a PC (back then it was mostly serial, but quickly became USB, ethernet, now WIFI, or bluetooth) I started making windows apps in... VB6, then VB.NET, then realised how gastly VB is, switched to C# but still using .NET most of the time. After years of reading hackaday articles, and reading posts on here it seems we are spoiled for choice in terms of what language we use for the 'PC host side'. Be it for full compiled apps using .NET/C# or scripted languages, python, java, processing etc.. safe to say I have very little experience in the latter examples.
So, for jobs where you've made your MCU-based hardware... say.. for sensors or human interface etc.. what did you use for the PC host software? And do you still use good 'ol serial (be it RS232, USB-serial adapters, or RS-485) or is it more common to choose USB (HID class rather than CDC?) or Ethernet, for remote systems.
I constantly feel like I'm 'missing out' by not knocking up python scripts or java applets when I need a bit of bespoke software for my own projects, even though I can probably get a half decent GUI quick 'app' knocked up in visual studio using .NET in a few hours. - an example of that would be a small app that imports a *.wav file and sends it to a AVR MCU via serial port to load in a flash chip for playback.
I'm sure there is 'better' (as in faster, neater, easier?) way to make such applications and also it would be good for me to learn some scripting languages (mostly java .. but python seems very popular too). But I'm asking if people on the forum actually use these. I have always wanted to add 'data visualization' to applications (graphs, dials etc..) but being locked into .NET's tools I think is stifling. So what are the common languages and tools you use?
-
#1 Reply
Posted by
ajb
on 11 Apr, 2017 17:06
-
I've been thinking about this recently as well. I've done a bit of python, which has of course a lot of available extensions including several GUI toolkits. I've used matplotlib to do some basic trend plots and that works fairly well, although implementing user interaction with the graphs (pan, zoom, etc) seems to be a bit cumbersome.
One option that's caught my eye is
Electron. I'm sure people will respond with how it's automatically terrible for being all web-derived, but the possibility of leveraging the layout and styling power of HTML/CSS and the rich user interaction capabilities of javascript (including many of the popular JS frameworks) for cross-platform desktop applications is pretty appealing. Apparently there is support for accessing serial ports from within Electron, but I haven't investigated that or any other connectivity facilities yet. I assume it's possible to tie into backend stuff written in other languages where necessary.
-
#2 Reply
Posted by
max_torque
on 11 Apr, 2017 18:16
-
It's an interesting question and one i also would be fascinated by the answer (which i suspect will not be straight forward, as there are so many options to choose from!)
I am spoiled because at work, i use a tool chain that costs thousands, and it means i can design a model in Mathworks Simulink, auto code it to the target controller, then flash and calibrate that target using ETAS INCA over CCP/XCP etc. As a tool chain, that's a multi thousand £££ capability.
What i'd love is a simpler, hobby version, with a robust software front end, that loads standard target descriptor files (probably .xml format) and enables relatively seamless system optimisation without rewriting the code every time!
-
#3 Reply
Posted by
rstofer
on 11 Apr, 2017 18:55
-
I am more than willing the use VB for the host side regardless of the type of communications. Serial, HID, Ethernet, doesn't matter.
Lately I have been playing with C# but I haven't done anything on the outside. I suspect it will work fine. I did play around with Microsoft's IoT platform for a while but I don't have an application. All my toaster needs to do is make toast. I don't expect it to display Headline News.
My watch does that... No it doesn't!
Interesting project: Add knobs, switches and dials to Microsoft Flight Simulator using an AVR on the sensor/display end with HID transmission to a bit of C code connecting to a library provided by Microsoft. If I were more interested, I would build a full function cockpit for the F106. At the time, I didn't have room. Now I have a 4 car garage and the cars stay outside so it would be possible. Hm...
-
#4 Reply
Posted by
sanwal209
on 11 Apr, 2017 18:58
-
From last 10 years I have used different softwares to design GUI. I did start from VB6. Best choice would be either .net or Labview. In Python you need to make gui by coding int text and trust me its so much time consuming. Debugging is 75% guess work, 25% magic powers. For me its the matter of time. Try making a simple uart string dump from python and you will get the idea.
-
#5 Reply
Posted by
krho
on 11 Apr, 2017 19:18
-
One option that's caught my eye is Electron. I'm sure people will respond with how it's automatically terrible for being all web-derived
It is terrible just see what a memory/CPU hog Slack desktop app that uses it is.
You can also look at Lazarus if you are more in Deliphi/Pascal watters
-
#6 Reply
Posted by
^_^
on 11 Apr, 2017 21:31
-
I remember I had to write PC-side UART receiver once, that would work at 3.5 Mbps. I have chosen Visual Studio C# for that and it's serialport control.
It worked and it would even display the data in chart control in real time as well as log the data into a file. The app was multi-threaded and the chart thread as well as receiver thread would sit at 100% core load (which was 50% overall at 4-core PC I was using).
The point is, if you need something simple, then high-abstract stuff like you mentioned (Python, Java) is probably the way to go.
But... if you need performance, then C# or C++ are still irreplaceable.
IMHO.
-
#7 Reply
Posted by
Buriedcode
on 11 Apr, 2017 21:47
-
So it seems that many still use .NET and create stand alone applications. I'm surprised, and kind of relieved as I thought I was completely behind. Also surprised that people still use the serial port, although not that much as the few 'industry' people I know regularly do serial port stuff.
I guess I asked because I was looking to finally get to grips with Java, python, and possibly other languages and as I'm very much an electronics guy - looking for example projects where people had created PC-side apps as part of it. Also.. does anyone use processing? I've used it a couple of times to visualize the waveform for an optical pulse sensor but never in earnest.
-
#8 Reply
Posted by
tggzzz
on 11 Apr, 2017 22:05
-
Usually the language is the least important consideration.
Far more important are the libraries for GUI and/or processing, libraries for comms, compatibility with deployment considerations, and familiarity with the development environment.
Having said that, some languages enable you to concentrate more on solving your problem, other make you concentrate too much on solving the language and implementation problems.
-
#9 Reply
Posted by
ebclr
on 11 Apr, 2017 22:12
-
Radstudio is a very power option
Pro's cross-platform , easy to use, lot of legacy
Cons's
Price
-
#10 Reply
Posted by
lem_ix
on 11 Apr, 2017 22:23
-
Python, bloody simple
From not knowing it to poorly plotting data from a wireless sensor network took 2-3 days.
-
#11 Reply
Posted by
danmcb
on 12 Apr, 2017 01:03
-
depends what. For a GUI app, c#/.NET. But I rarely do this. For messing with text files - perl. These days - python tends to crop up.
-
#12 Reply
Posted by
digsys
on 12 Apr, 2017 01:46
-
+1 for VB6 /.NET
-
#13 Reply
Posted by
Scrts
on 22 Nov, 2017 04:03
-
Hello,
I want to bring this up just to check if there are any new opinions? I've never done any PC communication rather then LwIP with a web server, so now I struggle to find good examples for communications over USB. I just want some GUI with a button or a slider as well as indicator or something hooked up to STM32 over USB. Whether it's HID, VCP or whatever... Are there any good examples about this? Visual Studio C# or some Qt? Python maybe?
There was Borland C++ builder in the old days, but now I'd prefer something available for free.
-
#14 Reply
Posted by
danadak
on 22 Nov, 2017 13:18
-
-
#15 Reply
Posted by
TomS_
on 22 Nov, 2017 13:48
-
Try making a simple uart string dump from python and you will get the idea.
Im working on a project where I am using serial to communicate with a PIC.
I used the pyserial library and it was
very straight forward.
Unless you were trying to do something much more low level, which pyserial hides (kind of the point).
-
#16 Reply
Posted by
abraxa
on 22 Nov, 2017 13:54
-
I would just like to point out that with Qt Creator / Qt Designer, there are RAD solutions available for Qt as well. There's no need to create the UI elements by hand, which of course is rather time consuming.
-
-
Just the same toolset I use for embedded development:
Linux (or cygwin at work where I must use a windows machine), gcc, make, version control, editor of your choice.
My favourite language is still plain C, my PC-side applications usually are console I/O to the user side, and CAN, serial or TCP/IP to the embedded device side.
I stay away from USB since either the cables are too short or it just works unreliable or you're in driver hell.
No GUI, command line parameters rock
If I need some graphing output, I write the data to a suitable file and place a bit of scripting around gnuplot
Another way is to feed the data into an RRD (round robin database) and use its PNG output inside a simple html page with a bit of php scripting.
-
#18 Reply
Posted by
asmi
on 22 Nov, 2017 14:25
-
I use mostly .NET/C# (since I use it professionally at work so it's a no-brainer), unless I need to use some kind of vendor-supplied library, in this case it's usually C/C++. Case in point - FTDI's D2XX and D3XX API libraries that work with their ICs over USB.
-
#19 Reply
Posted by
Karel
on 22 Nov, 2017 14:28
-
We write pc-side applications in Qt.
Reasons: it runs virtually on every platform, it's fast, object oriented, very good documentation, active community and forum,
comes for free but payed support is also available and there are already a lot of widgets available to start quickly.
-
#20 Reply
Posted by
Buriedcode
on 22 Nov, 2017 15:05
-
Good to see people updating the thread!
I've just downloaded Qt, and will write a few test apps. I've been meaning to make some bluetooth apps for my phone and tablet anyway, so this - along with using Xamarin - will be a good intro to it all.
Although I'm more of a nuts 'n'bolts guy, swanky looking graphs and controls are always appealing - I used to code them from scratch many years ago, and they rarely looked good.
Cheers!
-
#21 Reply
Posted by
Karel
on 22 Nov, 2017 15:33
-
-
#22 Reply
Posted by
rstofer
on 22 Nov, 2017 19:33
-
If I need a 'forms' interface, it will most likely be done in VB - I'm lazy.
OTOH, when I wanted to add physical buttons, knobs and dials to Microsoft Flight Simulator, I made the gadgets report as a HID interface and used C to tie the values into the simulator.
The HID interface is pretty easy to work with but if I'm in a hurry, I'll use VCOM. Any of the Microsoft languages can deal with a serial port. In fact, I wrote a little shim code to support a serial port under GNU Fortran. I don't recall why... Maybe just because I could and I still use Fortran for numerical kinds of things.
Matlab is another possibility. There's an Arduino toolkit that links Simulink with hardware. Matlab can provide a very interesting dashboard for external gadgets.
As to environment, there are 3 general cases. First, the environment provided by the device manufacturer. Second, Microsoft Visual Studio and finally, Eclipse. It may also turn out that the manufacturers are using Eclipse as the IDE with modifications. All this for Windows... For Linux, it will be Eclipse or gedit and makefiles. I haven't done a lot of GUI stuff under Linux.
I have played with Qt and Tkinter using Python.
-
#23 Reply
Posted by
Scrts
on 22 Nov, 2017 19:51
-
Ok, I don't see anyone using LabView CVI?
As for the middleware level - libusb doesn't seem to be popular as well?
For Qt people - do you have a good website for examples with embedded platforms? I've never touched Qt, so a simple example would be a good place to start.
-
#24 Reply
Posted by
Karel
on 22 Nov, 2017 19:56
-
-
#25 Reply
Posted by
rstofer
on 22 Nov, 2017 21:42
-
For Qt people - do you have a good website for examples with embedded platforms? I've never touched Qt, so a simple example would be a good place to start.
That's going to depend on what you mean by embedded. Most projects are going to use Qt->X11->Linux. Sure, that can be an embedded SOC like the Raspberry PI but it isn't embedded like Arduino (just to pick a tiny platform).
There are lots of Qt/Python examples and books have been written on the subject.