Giter VIP home page Giter VIP logo

macchina-io / macchina.io Goto Github PK

View Code? Open in Web Editor NEW
510.0 77.0 152.0 125.36 MB

macchina.io EDGE is a powerful C++ and JavaScript SDK for edge devices, multi-service IoT gateways and connected embedded systems.

Home Page: https://macchina.io

License: GNU General Public License v3.0

Makefile 0.11% C++ 64.84% C 11.28% CMake 0.08% HTML 0.20% JavaScript 21.06% CSS 0.08% Shell 0.10% Perl 0.01% Batchfile 0.01% Python 2.05% Emacs Lisp 0.01% Lua 0.01% Scheme 0.01% R 0.01% Vim Script 0.01% Dockerfile 0.01% Assembly 0.01% TypeScript 0.15%
macchina sensor linux embedded-applications iot iot-framework javascript c-plus-plus edge edge-computing

macchina.io's Introduction

macchina.io

macchina.io EDGE (GPL)

macchina.io EDGE is a powerful application software platform for IoT devices.

This is the GPL-licensed version of macchina.io EDGE.

A commercially-licensed version with an extended feature set, full source code and professional support is available.

Note that this GPL-licensed version:

  1. is only occasionally updated,
  2. does not contain all features from the commercial version,
  3. is provided as-is, without any support or warranty of any kind.

With macchina.io EDGE you can rapidly build and deploy device applications that communicate with devices, sensors, actuators, cloud services, and humans.

macchina.io EDGE provides a web-enabled, secure, modular and extensible C++ and JavaScript IoT application environment on top of Linux, consisting of middleware, protocols and rich APIs. macchina.io EDGE provides ready-to-use and industry proven software building blocks that enable applications to collect, process, filter, analyze and visualize sensor, machine and process data locally, directly where it originates, and where the action happens. macchina.io EDGE enables IoT edge computing.

macchina.io EDGE runs on Linux-based devices, including IoT gateways, industrial computing devices, and prototyping platforms like the Raspberry Pi and Beaglebone.

macchina.io EDGE is based on the POCO C++ Libraries and uses the V8 JavaScript engine.

For more information, including documentation, please see the macchina.io website. There are also a couple of useful articles and How-To's in the project wiki.

Prerequisites

  • GNU Make 3.81 or newer
  • Linux: GNU C++ (g++) 5.0 or newer; alternatively Clang++ 3.4 or newer (C++14)
  • macOS: Clang++ (Apple LLVM) 10.0 or newer
  • OpenSSL headers and libraries (on macOS, via Homebrew: brew install openssl)
  • Python 3.9 or newer (for building V8)
  • Avahi or Bonjour SDK for DNS-SD Support (optional)

Ubuntu

$ sudo apt-get install -y make g++ libssl-dev python-is-python3

Raspberry Pi (64-bit)

$ sudo apt-get install -y git make g++ libssl-dev

Note: We recommend using a 64-bit version of Raspberry Pi OS. The combination of a 64-bit kernel (default for recent Raspberry Pi OS versions) with a 32-bit userland causes the build to fail.

macOS (with Homebrew)

$ brew install openssl [email protected]

NOTE: On macOS, the python command must run Python 3.9 or newer in order to build V8. If installed via Homebrew, add the following directory to your $PATH:

Apple Silicon: /opt/homebrew/opt/[email protected]/libexec/bin

Intel: /usr/local/opt/[email protected]/libexec/bin

Getting Started

For the impatient, using a Linux or macOS machine:

$ git clone https://github.com/macchina-io/macchina.io.git
$ cd macchina.io
$ make -s -j8 DEFAULT_TARGET=shared_release

Then, on Linux (x86_64):

$ . env.bash
$ cd server
$ bin/Linux/x86_64/macchina

On Raspberry Pi (aarch64)

$ . env.basah
$ cd server
$ bin/Linux/aarch64/macchina

On macOS (Apple Silicon):

$ . env.zsh
$ cd server
$ bin/Darwin/arm64/macchina

Then direct your favorite web browser to http://localhost:22080 and log in with username admin and password admin.

To build macchina.io EDGE without JavaScript support, you can pass WITHOUT_JS=1 to make:

$ make -s -j8 WITHOUT_JS=1 DEFAULT_TARGET=shared_release

For more detailed instructions, including how to cross-compile for embedded Linux targets, as well as an introduction to writing JavaScript code for macchina.io, see the documentation, specifically Introduction and Overview and Getting Started with macchina.io.

Enabling or Disabling macchina.io EDGE Components

To control which components are built, the components.make file can be edited. Comment or uncomment specific lines to control which components are built.

Licensing

macchina.io EDGE is dual-licensed under a commercial license and the GPLv3. The commercial license gives you the full rights to create and distribute software and devices on your own terms without any GPL obligations. With the commercial license you also have access to professional support and maintenance, as well as many additional features. See this table for a comparison between GPLv3-licensed and commercial-licensed macchina.io EDGE features.

macchina.io's People

Contributors

aleks-f avatar alterratz avatar florianbehrens avatar obiltschnig avatar stefanhai avatar uilianries avatar whitewinter avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

macchina.io's Issues

MQTT Client

macchina.io needs a MQTT client. We will not implement our own broker, however, we'll want to have our own client implemented as a OSP service bridged to JavaScript. The client should be able to connect to a server or broker over TCP and SSL and should support the latest MQTT 3.1.1 specification.

CMake

It would be nice to have CMake support for macchina.io like the poco project.

Configuration issue generating stubs

I was creating a new Device class, but was very difficult to understand why the generated stubs didn't extend the right classes...
Took a lot to discover the trick.... or the right configuration.

I suggest to change OSP to true by default in file devices/Devices/RemoteGen.xml and add the flowing:

        <osp>
            <enable>true</enable>
        </osp>

Thnks,
JP

GNSS receiver interface

We need an implementation of GNSSSensor interface for GNSS/GPS receivers providing a serial NMEA 0183 data stream.

POCO Library issue

Do poco libraries need to be installed before building macchina or come together with this project?
After building the project and try to run it, I get the following error:

error while loading shared libraries: libPocoOSP.so

Paho needs -D_GNU_SOURCE on Linux

On my Linux distro I couldn't get Paho to compile unless it had the -D_GNU_SOURCE flag defined. If this wasn't defined it didn't know the addrinfo type which is guarder by

ifdef __USE_GNU

struct addrinfo ar_result; / Pointer to result. */

inf the netdb.h file.

This file belongs to glibc 2.22 on my system.

MQTT Subscription Question

How do I expose "tcp://iot.eclipse.org:1883" to the external network?
Do I need to use a MQTT broker like mosquitto?

Thanks for the help,

Dan

Generate client-side Remoting code from IoT::Devices

I'm not sure if it is a bug or I did something wrong.
I read the document https://macchina.io/docs/00100-RemotingNGOverview.html about Remote NG and try to generate the client-side Remoting code from macchina.io/devices/Devices (IoT::Devices).

I create a RemoteGen.xml.zip and execute the generator as following:
../macchina.io/platform/RemotingNG/RemoteGen/bin/Linux/x86_64/RemoteGenNG -cRemoteGen.xml -DPOCO_BASE=../macchina.io/platform -DPOCO_OSP_DEVICES=../macchina.io/devices/Devices -Cclang

The RemoteGenNG generates for example from the Accelerometer class the expected classes AccelerometerClientHelper, AccelerometerEventSubscriber, AccelerometerProxy and AccelerometerProxyFactory.
But in the AccelerometerEventSubscriber class they generate an inheritance to IoT::Devices::DeviceEventSubscriber instead of Poco::RemotingNG::EventSubscriber.
In the AccelerometerEventSubscriber header an include of Poco/RemotingNG/EventSubscriber.h exists.
What is going wrong here?

Pass GET or POST param to devices.jss

Hi I want to pass get/post param to devices.jss from controllers.jss, so I can call setPropertyString method with user specified value.
Can you guide me how i can retrieve get/post params in devices.jss

Service Registry question

Can someone clarify how ' serviceRegistry.find(
'io.macchina.physicalQuantity == "temperature"');' locates the sensor I've currently connected?
Do we need explicitly specify Pin Port number, beacuse I've tried connect a temperature sensor but temperature value keep going from simulated one?

Support for Linux GPIOs

Linux userspace GPIOs (via sysfs) should be accessible via a GPIO service to both C++ and JavaScript.

OSP Web Server: clear cache when bundle is removed

Static resources in the in-memory OSP Web Server cache must be removed when the bundle providing them is removed. Currently they stay in the cache, which leads to old data being served when a bundle is upgraded.

IDE Question

Hi Gunter,

I'm wondering, which IDE are you using for development under Linux ?

I'm new to C++ world (coming from Java), and the best thing I found is Emacs with irony. Your answer is going to help me to adopt macchina.io development style :)

Thanks a lot.

Move platform into separate project

As the title says, create a generic platform for development of application servers by moving macchina.io/platform into a separate project.

Firefox Debugger Integration

Check whether the new Firefox Debugger could be integrated into macchina.io. The debugger currently required node.js plus some web frameworks on top of node.js, but maybe the server-side could be reimplemented in C++ based on OSP Web.

Web User Interface

macchina.io needs a web-based user interface supporting the following features:

  • start/index/launchpad page (links to available applications)
  • bundle administration (like OSP BundleAdmin, but with modernized UI)
  • script editor (create and edit JavaScript applications using a web-based editor)

XBee ZB Sensors

Provide support for XBee ZB sensors (specifically, the combined temperature, humidity and light sensor).

Building Macchina.io on Eclipse CDT

Could someone guide how to correctly build project on Eclipse in Linux. Building it without configuring build options gives error for 'all' command.

Poco-Source

I'm wondering that there is a copy of the poco libraries in this project. I think it's better to include poco as a git sub module, because in this case bugfixes from poco are also available for macchina.io. The mirai bot net used insecure IoT devices so it's neccesary to update macchina.io as fast as possible after a bugfix has been submitted to poco.

Compile error in Paho: addrinfo incomplete type on Linux

Since Ubuntu 16.04 I got this compile error:
macchina.io/protocols/MQTT/Paho/src/Socket.c:599: Fehler: variable 'hints' has initializer but incomplete type
struct addrinfo hints = {0, AF_UNSPEC, SOCK_STREAM, IPPROTO_TCP, 0, NULL, NULL, NULL};
^

I spend some time to investigate the problem and I found following problem/solution:
In macchina.io/platform/build/config/Linux
there is a SYSFLAG define with:
-D_XOPEN_SOURCE=500

This define use:
_POSIX_C_SOURCE defined: 199506L

This means, to use the POSIX API version POSIX.1-1996

When I remove the define _XOPEN_SOURCE then following POSIX version is used:
_POSIX_C_SOURCE defined: 200809L

This means, to use the POSIX API version POSIX.1-2008

In netdb.h I found following comment:
...
/* Extension from POSIX.1g. */

ifdef __USE_POSIX

/* Structure to contain information about address of a service provider. */
struct addrinfo
...

addrinfo is an extension from POSIX.1g ?
I search in man feature_test_macros(7), man getaddrinfo, on http://pubs.opengroup.org/onlinepubs/9699919799/ for POSIX.1g but I did not found why the behaviour is changed.

To remove _XOPEN_SOURCE works also for Ubuntu 14.04.

Maybe it's better to use: -D_GNU_SOURCE
then we can remove _LARGEFILE64_SOURCE because
this use following defines:
_POSIX_SOURCE defined
_POSIX_C_SOURCE defined: 200809L
_ISOC99_SOURCE defined
_ISOC11_SOURCE defined
_XOPEN_SOURCE defined: 700
_XOPEN_SOURCE_EXTENDED defined
_LARGEFILE64_SOURCE defined
_DEFAULT_SOURCE defined
_ATFILE_SOURCE defined
_GNU_SOURCE defined

See man feature_test_macros(7) for more details.

It's a good idea to test this also on other Linux Distros.

Here some glibc information about Ubuntu:
Glibc Version on Ubuntu 16.04 (xenial)
GNU C Library (Ubuntu GLIBC 2.23-0ubuntu3) stable release version 2.23, by Roland McGrath et al.
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 5.3.1 20160413.
Available extensions:
crypt add-on version 2.1 by Michael Glad and others
GNU Libidn by Simon Josefsson
Native POSIX Threads Library by Ulrich Drepper et al
BIND-8.2.3-T5B
libc ABIs: UNIQUE IFUNC
For bug reporting instructions, please see:
https://bugs.launchpad.net/ubuntu/+source/glibc/+bugs.

GLibc Version on Ubuntu 14.04 (trusty)
GNU C Library (Ubuntu EGLIBC 2.19-0ubuntu6.9) stable release version 2.19, by Roland McGrath et al.
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 4.8.4.
Compiled on a Linux 3.13.11 system on 2016-05-26.
Available extensions:
crypt add-on version 2.1 by Michael Glad and others
GNU Libidn by Simon Josefsson
Native POSIX Threads Library by Ulrich Drepper et al
BIND-8.2.3-T5B
libc ABIs: UNIQUE IFUNC
For bug reporting instructions, please see:
https://bugs.launchpad.net/ubuntu/+source/eglibc/+bugs.

How you get glibc version:
Execute on the command line libc.so.6
Where this library is found depends on your Linux distro.
For example, in Ubuntu (with multi arch support) you found this:
/lib/x86_64-linux-gnu
/lib/x86-linux-gnu
Maybe also
/lib, /lib64, /lib32, /libx32

Communication Between two Bundle

Hi,
I have two bundle, One is websocket client which communicate to server(send status of all devices to server and execute any command from server). And another bundle which fetch data from sensors. Sensor bundle have some configuration like fetch interval, fetch data etc. Now I wants, when I received command from server, as per command I want to update fetch Interval or other parameter. I had seen this can be done using js by setPorperty method, but I need to do same using C++ code.
Please suggest some method for it.

Thanks in advance.

HTTPRequest and binary content

Currently HTTPRequests only supports text data, which is available as a string. If binary data is detected, this should be delivered via an appropriate V8 type.

Tinkerforge Bindings

Following Tinkerforge bindings need to be done:

  • Ambient Light
  • Barometer
  • Dual Button
  • GPS
  • Humidity
  • IO-4
  • Motion Detector
  • Rotary Encoder
  • Temperature

Build error

I tried to build macchina.io by following the guidelines from http://macchina.io/docs/00150-MacchinaGettingStarted.html on a Linux Mint v17.1 and v17.3. However, every time I get the following error during build. Is there something I do wrong?

The steps to reproduce this are:

  1. clone the repo
  2. run sudo make -s -j8 (as described in the tutorial)

CXX(target) /home/andrei/environment/macchina.io/platform/JS/V8/v8-3.25.28.18/out/x64.debug/obj.target/cctest/test/cctest/test-cpu-x64.o
CXX(target) /home/andrei/environment/macchina.io/platform/JS/V8/v8-3.25.28.18/out/x64.debug/obj.target/cctest/test/cctest/test-disasm-x64.o
CXX(target) /home/andrei/environment/macchina.io/platform/JS/V8/v8-3.25.28.18/out/x64.debug/obj.target/cctest/test/cctest/test-macro-assembler-x64.o
CXX(target) /home/andrei/environment/macchina.io/platform/JS/V8/v8-3.25.28.18/out/x64.debug/obj.target/cctest/test/cctest/test-log-stack-tracer.o
CXX(target) /home/andrei/environment/macchina.io/platform/JS/V8/v8-3.25.28.18/out/x64.debug/obj.target/cctest/test/cctest/test-platform-linux.o
SOLINK(target) /home/andrei/environment/macchina.io/platform/JS/V8/v8-3.25.28.18/out/x64.debug/obj.target/tools/gyp/libv8.so
LINK(target) /home/andrei/environment/macchina.io/platform/JS/V8/v8-3.25.28.18/out/x64.debug/cctest
COPY /home/andrei/environment/macchina.io/platform/JS/V8/v8-3.25.28.18/out/x64.debug/lib.target/libv8.so
CXX(target) /home/andrei/environment/macchina.io/platform/JS/V8/v8-3.25.28.18/out/x64.debug/obj.target/shell/samples/shell.o
CXX(target) /home/andrei/environment/macchina.io/platform/JS/V8/v8-3.25.28.18/out/x64.debug/obj.target/process/samples/process.o
CXX(target) /home/andrei/environment/macchina.io/platform/JS/V8/v8-3.25.28.18/out/x64.debug/obj.target/lineprocessor/samples/lineprocessor.o
CXX(target) /home/andrei/environment/macchina.io/platform/JS/V8/v8-3.25.28.18/out/x64.debug/obj.target/d8/src/d8.o
LINK(target) /home/andrei/environment/macchina.io/platform/JS/V8/v8-3.25.28.18/out/x64.debug/shell
LINK(target) /home/andrei/environment/macchina.io/platform/JS/V8/v8-3.25.28.18/out/x64.debug/lineprocessor
LINK(target) /home/andrei/environment/macchina.io/platform/JS/V8/v8-3.25.28.18/out/x64.debug/d8
LINK(target) /home/andrei/environment/macchina.io/platform/JS/V8/v8-3.25.28.18/out/x64.debug/process
TOUCH /home/andrei/environment/macchina.io/platform/JS/V8/v8-3.25.28.18/out/x64.debug/obj.target/build/All.stamp
make: *** [clean] Error 2

How to share data between bundle activator and HTTP handler

OK, so I keep my user objects in the bundle activator. I would also like to be able to access those objects from the HTTP handler factory registered as an extension point. Since both activator and handler are instantiated by the OSP environment, the only way to share data between them seems to be through a global variable (ugly). Is there a better way short of launching my own web server from bundle activator?

How to start with C++ sample

Hi, is there any documentation on how to start with C++, some sample, I can find for java script
but not for c++.

MQTT Clients Page

Hello,

Would it be better if there is a default topic subscription (i.e. macchina_io_test) that can be seen in MQTT Clients page?

Since I am a true beginner of macchina.io, I needed to spend much time to see an action on that page.
(I added "client.subscribe('macchina_io_test', 0);" into clients.jss. For now, I am not sure that this is the correct way of doing subscription.)

As a suggestion, maybe there can be a parameter in macchina.parameters file and beginners like me easily see MQTT clients working. :).

Thanks.
Erdem

Update bundled V8 to a more recent release.

While the bundled V8 release (3.25.28.18) is doing a good job in terms of stability, it's not up to date with ES 6 support. For release 1.0, we should consider updating to a newer release.

MQTT Client Screen

  1. I can't view the client's feed.

  2. I subscribed to macchina.io using MQTT-Lens to do a subscription to tcp:iot.eclipse.org:1883. The screen always says "no scubscription"

Yocto recipe

A Yocto recipe for building and installing macchina.io on Yocto devices would be nice to have.

Upgrading Bundle: verify name of upgrade bundle

When upgrading a bundle, the name of the new bundle must be verified. Currently it's possible to upgrade a bundle with one with a different symbolic name, leading to a failed upgrade. This must be prevented.

JSS and JSSP script pooling

In the current implementation JavaScript servlets and server pages are compiled whenever they are requested. From a performance perspective this is unacceptable. There should be a pooling mechanism that enables reuse of compiled scripts.

Using OSPSubsystem into a Shared library

Hello.
I would know if it is possible to use OSP into a shared library without using a class derived from poco application. Is it necessary to register the OSPSubsystem into an application in order to use it?
Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.