Skip to content

MADS-NET/arduino_plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Arduino plugin for MADS

This is a source plugin for MADS that reads a JSON string published by an Arduino connected via serial port on the MADS network.

This plugin has been updated for MADS v2

Installation

Linux and MacOS:

cmake -Bbuild -DCMAKE_INSTALL_PREFIX="$(mads -p)"
cmake --build build -j4
sudo cmake --install build

Windows:

cmake -Bbuild -DCMAKE_INSTALL_PREFIX="$(mads -p)"
cmake --build build --config Release
cmake --install build --config Release

INI settings

The plugin supports the following settings in the INI file:

[arduino]
port = "/dev/ttyUSB0"
baudrate = 115200
silent = true
connection_timeout = 5000
# the following can be omitted; if so, it is not used at all
cfg_cmd = ""

All settings are optional; if omitted, the default values are used.

Executable demo

The test main takes two alternative arguments: the path (or name, on Windows) to the serial port, or the -e, which enumerates all available ports and exits.

Arduino code

The arduino folder contains a sketch that can be customized to read different analog or digital pin and publish a corresponding JSON string on serial port.

The script supports a simple command parsing interface that allows to configure some settings on the Arduino side. Look at the arduino code for details, but this allows to set the cfg_cmg setting as 250p20t, for example, to set the sampling period to 250 ms and the threshold to 20 (in the range 0–1023).

Issues

Currently, on Windows sometimes it gets stuck. To unlock it, open the serialport monitor with the Arduino IDE, and close it.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors