I'm do a project to control a gpib-usb converter from national instruments. I will run the app on raspberry pi 2 using a windows 10 iot core. On this configuration, is only possible to do a universal app to run. That's what i do.
The library is in c/c++, so comes with a gpib-32.obj.
Here is the trouble, when i compile my universal app on raspberry pi, give me the error Error LNK1112 module machine type 'X86' conflicts with target machine type 'ARM'.
There is somehow i can do this app run? If i delete this file, the library don't work.
regards, vitor.
Your choices are to either recompile the library from the source code using the gcc that's on the raspberry pi or use C#.
When using the raspberry pi, I use the debian (raspbian) linux build. I researched the windows 10 for raspberry pi and found it to be a cruel joke intended to sabotage the raspberry pi project.
I have good luck running mono on the raspberry pi to get c# programs running without recompiling the program for the raspberry pi.
I hope this guides you in the right direction.
Related
We have written a x-plat worker service using .NET 5 that is running on a Raspberry PI 4 (Raspberry Pi OS). We have trained a custom vision object detection model on customvision.ai, exported it to ONNX and it all works well on Windows.
We are now struggling to get it running on the Pi. The ML.NET bits does not seem to work on the Pi. We're getting (with target runtime "linux-arm"):
Microsoft.ML currently supports 'x64' and 'x86' processor architectures. Please ensure your application is targeting 'x64' or 'x86'
We've searched hi and low for any working examples. We've also tried to export to Tensorflow format and explore Tensorflow.NET without any success.
Can anyone point to an example that is consuming a customvision.ai generated model in .NET Core/5 on a Raspberry PI? We are extending an existing prototype and would like to avoid rewriting it all in Python/C++ or create out of process calls.
Versions: ML.NET 1.6, Microsoft.ML.OnnxRuntime 1.8.1
Many thanks,
Mansos
Just incase someone else lands here...
The release ML.Net NuGets (mid Dec 2021) now have support for linux-aarch64, linux-arm, linux-arm64, Windows-x64 etc.
If you're still interested I have have a couple of blog posts about my "learning journey" getting a pretrained ONNX model working on RPI4B + Bullseye and ASUS PE100A + Ubuntu
#KiwiBryn
Are you running an Uno Platform app to capture a picture from the camera module (or usb webcam) in your Pi4 and running ML.Net too?
I've been writing a C++ TUI application to run in the terminal of my raspberry pi using the ncurses library. I've been doing this using the linux remote C++ development add-on in Visual Studio, but I've run into some hurdles into how I should go about debugging it.
Built into visual studio there is a linux console window which displays the output of the ssh connection visual studio makes with the raspberry pi, so if you're writing a console interface using nothing but std::cout and std::cin it does the job for interacting and debugging the app. Ncurses however does not use the standard input and output streams, and therefore the ncurses interface written in code does not appear in the linux console window.
Therefore, essentially what I want to be able to do is interact with the output of my application on my raspberry pi screen when I build and run my linux solution in visual studio instead of using the linux console window. I want a terminal window with my ncurses application running in debug mode to spawn in on the primary display of my raspberry pi, whilst still having the full debug controls for it in visual studio (like breakpoints and such). I do not know how to do this though.
I have seen in other tutorials for debugging GUI applcations (using, for example, GTK) written for linux using visual studio that the "Pre-launch Command" property found in the debug properties page of the C++ Linux project might be the key to do this. In the GTK GUI tutorial, they put the command export DISPLAY=:0.0 in this property in order for the GUI application in debug mode to spawn in on the primary display of the raspberry pi. This does not work for TUI applications however. I am hoping therefore for the solution to my problem being as simple as finding the right argument to put in this property.
The link to the GUI tutorial I'm referring to here is http://comfilewiki.co.kr/en/doku.php?id=comfilepi:create_a_linux_project:index#specify_the_include_paths_in_the_project_s_properties
Thank you to whoever helps me out.
A RaspberryPi can run some Linux distribution derived from Debian, e.g. Raspbian.
A RaspberryPi has wifi and ethernet. You should be able to configure them to serve ssh(1) thru sshd(8) either thru wifi or thru ethernet.
Once an sshd server is running on your RaspBerryPi, you just use ssh on your Linux cross-development machine to access it on the command line.
The gdb debugger has remote debugging facilities, but you could just run it on the RaspBerryPi accessed thru ssh
I've been writing a C++ TUI application to run in the terminal of my raspberry pi using the ncurses library.
I have a simpler recommendation :
debug your C++ TUI application on your laptop or desktop running some Linux distribution.
Only once it is debugged cross-compile it for your RaspBerryPi.
Most C++ applications can be written with enough care to be easily ported from Debian running on your x86-64 laptop to Raspbian running on your RaspberryPi. Be careful to stick to the C++11 (read n3337) or C++17 standard. Enable most warnings when compiling with a recent GCC, even if it is a cross-compiler. So use at least g++ -g -Wall -Wextra and improve your C++ source code to minimize compiler warnings.
Recommandation: install some Linux distribution on your development laptop or desktop.
For that you just need less than a hundred gigabytes of consecutive free disk space. Both Ubuntu and Debian are very easy to install, and freely downloadable.
Once Linux is running on your laptop or desktop, and Raspbian is running on your RaspberryPi, you just need to connect them e.g. using an Ethernet cable.
I recommend installing the build-essential and crossbuild-essential-arm64 packages on Debian (or Ubuntu) on your Linux laptop. Also consider installing the git version control, the emacs editor (and/or geany and/or visual studio code), the gdb debugger, the g++ compiler, the doxygen documentation generator, perhaps the Qt graphical toolkit, the ninja build automation tool, the GNU guile and/or Python and/or Lua and/or GNU awk scripting language
Don't forget to spend a few days in reading documentation.
i've a Raspberry pi 2 with the Amazon Kinesis Stream SDK (https://github.com/awslabs/amazon-kinesis-video-streams-producer-sdk-cpp) correctly running on board.
The compilation of the library was too long on the Raspberry pi 2, about 3H.
So the question, is there a way to pre-compile this library on a more powerful server and then copy the files on the Raspberry?
If it's possible i'd like to try this library also on Raspberry Pi Zero W (smaller in terms of size).
The installer instructions are here https://github.com/awslabs/amazon-kinesis-video-streams-producer-sdk-cpp/blob/master/install-instructions-linux.md
Thanks!
You could consider cross compiling your library - for example on a Linux PC. Cross compiling is very common. Think about App development targeting phones. You don't compile your code on the phone. You cross compile on a Mac or PC and then push your executable to the phone.
You can do the same with Raspberry Pi. Here are a couple links:
https://medium.com/#au42/the-useful-raspberrypi-cross-compile-guide-ea56054de187
https://hackaday.com/2016/02/03/code-craft-cross-compiling-for-the-raspberry-pi/
https://visualgdb.com/tutorials/raspberry/crosscompiler/
I want to compile C++ programs directly on Windows 10IoT for Raspberry Pi 2.
Is this possible?
I've built a relatively simple oF app which uses several 3rd-party addons. I've created the project with the project generator, and coded the whole thing in Xcode on OSX.
Now, I need to use this app on a Raspberry Pi running Raspbian. I've successfully compiled the armv6 version of oF, but I now need to compile the actual project.
So far I thought of the following options:
Try to get code::blocks running on the Pi, install oF for codeblocks, recreate the project and build.
Try to set up Ubuntu as a virtual desktop on my mac, set up a cross-compiler like this, recreate the project and build.
Pretend to be a magician – set up the OSX project on the Pi so that I could maybe compile it with make, except I have no idea whether this is possible at all.
???
So my question is: Given a severe deficiency of time and general skill when it comes to linux/compiling C++, what is the easiest way for me to get my oF app running on the Pi?
Many thanks!
The absolute easiest (and perhaps even fastest when accounting for the extra cross-compiler setup time) way is to use a Raspberry Pi 2 and compile everything directly on the board using all 4 cores. It is actually quite quick and easy to set up. To set it up, follow these instructions:
http://forum.openframeworks.cc/t/raspberry-pi-2-setup-guide/
If you would like to use a more friendly IDE like Xcode, I would recommend developing your code on OSX and then copy the project folder over to the Pi2 and execute the makefiles as noted in the setup guide above.