Giter VIP home page Giter VIP logo

serialsd_opendet's Introduction

SerialSD

alt text

SerialSD is a project to manage configuration and log file via serial.
This project needs one Arduino's compatible board and SdFat library.

How it works

This software must be upload into an Arduino's board with SD Adapter and this memory must be formatted in FAT32.
Afterwards, creation of non-empty single file named CONFIG.TXT is required with a syntax like this:

key1:value1
key2:value2

":" is the default delimiter.

Then, connect RX and TX pin to your main board project and start to send serial requests.

Schematics

Serial request

For the sake of simplicity, a serial request has the same config file's syntax.
Serial has \n terminator and it was set 150 like maximum buffer size .
Actually, there are these commands:

  • GET:key return value from key.
  • LOG:hello write into log file hello string. If file doesn't exist, it will be created.
  • ACK:test return the same request's string. This is useful when you want to know if system are available.

For the first part, case is insensitive. For each request, the result can be OK or ERR. When you got ERR, there are only some cases:

  • KEY_NOT_FOUND When you GET a key which doesn't exist.
  • IMPOSSIBLE_WRITE When you LOG but there're problems with SD.
  • BAD_REQUEST When format request is invalid.
  • MAX_TIMEOUT_REACH When Serial has recorded some bytes, but there's no terminator in 3 seconds.

System errors

SerialSD must be always on. So, all errors return a SYSERR and cause a sotware reset after 10 seconds.
Some possible troubles:

  • FILE_NOT_FOUND some required files weren't found.
  • BEGIN_SD_FAILED SdFat library begin failed.
  • UNKNOWN Unknown errors.

Add your configuration

To add your key configuration, go to configuration.h and insert your logic.

Test it!

test folder has many bash script files and you can launch them to test requests:

test/test_ack.sh /dev/ttyUSB0

serialsd_opendet's People

Contributors

keyro90 avatar thebrunez avatar

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.