Bliss OS (Pinebook) 20170919 [Oct 13] | Bliss OS (PINE A64(+)) 20170919 [Oct 13] | Linux Images (ROCK64) 0.5.10-118 [Oct 2] | Android Images (ROCK64) 0.3.4-86 [Oct 2] | Android 6.0.1 (PINE A64-LTS / SOPINE) 20170726 [Sep 29] | Android 7.1 (Pinebook) 0.3.10-66 [Sep 19] | Android 7.1 (PINE A64(+)) 0.3.10-66 [Sep 19] | Android 7.1 (SOPINE) 0.3.10-66 [Sep 19] | PINE64 Installer v2.0.0-beta.3 [Sep 12]

Getting Started | Visit the WIKI | IRC Logs | Forum Rules/Policy


Tool chain to write Pine 64 linux apps on a Windows Dev machine
#1
I'm a professional software developer (but not a Linux developer) so this question is not "How do I code an app?"  The question is "What's the easiest way to write Pine64 code to handle GPIO events."


Details:  I want to build a background process for my Pine64 (running Debian) to handle GPIOs so that I can power on/off a few things either via Node-Red (already installed on the pine), or by manually pushing a button on my Pine64 case.  The program logic is done, but I'm struggling to find a tool chain that I can use to create the program.  Either I can't compile the code, or once I get an executable running, it doesn't seem to run.  

In a perfect world, I'd love to get C# on the Pine64 working, but I'd be happy with any standard language (C, C++, etc.) that I can write and compile on my main dev machine, which runs Windows 10.  (It can run Linux in a VM if required for compiling.  Heck, I could write it and compile it on the Pine64 via VNC, if that is what is needed.)

What I need is a "Hello World" or "Blink an LED" guide to get a background app/service going on the Pine64 from my Dev machine that covers:
  • What needs to be installed on my dev machine (software, dependencies, etc.)  and how do I execute builds (command line commands, etc.)? 
  • What language I should use (Needs to read/write to GPIOS, run as a background service, and make Node Red calls.  Minor file IO would also be nice)
  • What do I need to install/configure on the Pine 64 to get the executable to run?
  • What debugging patterns/tools can I use?  (Is there an IDE supporting debugger breakpoints?  Can I pause running code to inspect its state?  Am I limited to logging style debugging similar to on Arduino?  Are there Pine64 emulators that I can test the code with virtual GPIO inputs?) 
  • How do I deploy the compiled executable to run as a background service?  How do I update the executable with a newer executable each time I make a new version?
If I can simply get the above figured out, I can handle the rest of the app.  Its humbling how much of a dunce I feel like that I can't seem to get these basics figured out on my own.

In short, the ideal solution would be a way to code in C# on windows in an IDE and nice debugging on a local emulator.  Minimum solution would enable me to write something I can compile somehow into a Linux executable and at least lets me see some kind of logging-style debugging output.
Reply
#2
You have three options for programming the gpio(s) on the PineA64+:

1)  sysfs filesystem and bash scripting  /sys/class/gpio/...

2)  RPi-GPIO.PineA64

3)  PineA64-CPP


Forget what you know about x86 Intel hardware;  these are Arm SoC(s);  you need to understand the mux io lines gpio(s).  Also, forget what you know about C#;  this is a perfect world, and windows is not a part of it.

No. (1) above is the ability to export a gpio mux to user space and then read or write its state (value) with a bash script or other wrapper like python.  No. (2) above is the Raspberry PI (like) python interface to the gpio mux lines.  No. (3) above is a fairly recent C++ library for access to the gpio mux lines via C|C++.  

There are many examples (some from myself) in the forum here under Pine64+ ---> Hardware Accessories , POT ---> PI-2 Euler GPIO ports

We have included examples in sysfs, RPi, and C++;  we have shown how to blink the LED lab, run a brushless fan with software pwm, and other examples. 

Also, the PineA64+ is not an MCU.  It is a full blown gnu+linux computer;  you can do the development right on the board;  no need for C#, nor windows anything;  in fact what you know about the Win-Tel platform will just get in your way here.  Start with the three above, look through the forum, and visit us on the irc;  I won't do your work for you, but I can answer specific questions we you get stuck;
marcushh777    Cool

please join us for a chat @  irc.pine64.xyz:6667   or ssl  irc.pine64.xyz:6697

( I regret that I am not able to respond to personal messages;  let's meet on irc! )
Reply
#3
(07-17-2017, 09:33 PM)MarkHaysHarris777 Wrote: You have three options for programming the gpio(s) on the PineA64+:

1)  sysfs filesystem and bash scripting  /sys/class/gpio/...

2)  RPi-GPIO.PineA64

3)  PineA64-CPP


Forget what you know about x86 Intel hardware;  these are Arm SoC(s);  you need to understand the mux io lines gpio(s).  Also, forget what you know about C#;  this is a perfect world, and windows is not a part of it.

No. (1) above is the ability to export a gpio mux to user space and then read or write its state (value) with a bash script or other wrapper like python.  No. (2) above is the Raspberry PI (like) python interface to the gpio mux lines.  No. (3) above is a fairly recent C++ library for access to the gpio mux lines via C|C++.  

There are many examples (some from myself) in the forum here under Pine64+ ---> Hardware Accessories , POT ---> PI-2 Euler GPIO ports

We have included examples in sysfs, RPi, and C++;  we have shown how to blink the LED lab, run a brushless fan with software pwm, and other examples. 

Also, the PineA64+ is not an MCU.  It is a full blown gnu+linux computer;  you can do the development right on the board;  no need for C#, nor windows anything;  in fact what you know about the Win-Tel platform will just get in your way here.  Start with the three above, look through the forum, and visit us on the irc;  I won't do your work for you, but I can answer specific questions we you get stuck;

Hi Marcus,

Lets write as an article, post on maker blog and also on PINE64 wiki. Thanks

.. TL
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  how to share pine folder with windows? ealbers 2 110 09-16-2017, 03:46 PM
Last Post: MarkHaysHarris777
Lightbulb pdeclib pilib modules for Pine, Rock, Pinebook, Sopine MarkHaysHarris777 7 227 08-13-2017, 01:14 AM
Last Post: tllim
  Best OS for Pine A64+ abrmx 8 840 08-04-2017, 09:06 AM
Last Post: abrmx
  Will PINE A64+ (2GB) be ever ready for the makers? aromring 17 557 08-03-2017, 10:09 PM
Last Post: pfeerick
  read/write gpio in c example? ealbers 1 126 07-23-2017, 05:53 AM
Last Post: MarkHaysHarris777
  Running UniFi Controller on a Pine A64+ 1Gb board ishwest 7 1,189 07-15-2017, 09:24 AM
Last Post: smills
Lightbulb Co-Pine-ON, Boot co-processor assistant ecolezen 4 194 06-26-2017, 10:12 PM
Last Post: pfeerick
  Pine A64+ 2GB can´t boot elTorres 4 615 03-30-2017, 01:43 AM
Last Post: elTorres
  Slim line Pine Board adamjedgar 0 268 02-22-2017, 09:58 PM
Last Post: adamjedgar
  How do I know which Pine 64 model I have? stamminator 1 465 01-10-2017, 08:36 PM
Last Post: tllim

Forum Jump:


Users browsing this thread: 1 Guest(s)