meshtastic / framework-portduino

An Arduino API that sits on top of Linux and other operating systems. This lets you run Arduino code on Raspberry PI, desktops, etc... All as a standard user-space application.
GNU Lesser General Public License v2.1
22 stars 11 forks source link

Portduino

This is an attempt to port the Arduino API so that it can run on top of Linux (and other desktop operating systems). This is to facilitate the following use-cases:

We've been using this project successfully on a fairly sizable & popular Platformio project (Meshtastic) for the last several months. We use it both for our continuous integration tests (where we run our device software through crude simulated tests in github actions) and to support Meshtastic on linux for the Pine64 Lora USB dongle.

Description

Someone wanted Meshtastic for a new linux based tablet, so we made a new new thing (which might be useful for other projects).

We implement the 'ArduinoCore' libs/API layer and support the following device level access from user-space regular apps:

How to use

This project is currently very 'alpha' mostly to judge community interest. Once it is a bit more mature (if there is interest) I'm happy to send in pull-requests to 'platform-native' which add portuino as an optional framework. If you would like to try it now, you should only need to add something like the following three lines to your platformio.ini in the project you want to build.

platform = https://github.com/geeksville/platform-native.git 
build_flags = ${env.build_flags} -O0 -lgpiod 
framework = arduino

For an example (sizable) project that is using this see meshtastic-device. Every checkin to that project triggers a new build of the 'native/portuino' version of meshtastic and runs it as a simulation test. The github actions show the commands used to build the linux binary and the console output from running it.

TODO (short term)

TODO (long term)

Copyright 2020 Geeksville Industries, LLC and Copyright (c) 2011-2014 Arduino LLC. All right reserved. GPL LGPL license, see LICENSE file in this directory.