Embedis is an open source library for creating simple embedded dictionary servers. Embedis is used for embedding key-value dictionaries into the SRAM, FLASH, FRAM, NVSRAM, EEPROM, or SDcard memory systems of small, limited resource, embedded computing platforms, such as the Arduino(AVR), ARM Cortex, ESP8266, and others.
We needed to support several different persistent memory store types, for a number of "Internet of Things", and small embedded system projects.
These types include the internal processor/SoC based SRAM, FLASH, EEPROM, and Scratchpad SRAM memories, as well as externally attached FLASH, EEPROM, FRAM, NVSRAM and SDCard memories using I2C or SPI interfaces.
What is Embedis?Embedis is a very small, in-memory, data structure store for key/value pairs; and why it is also known as a "keystore server". Embedis can be used as a database, cache, and message broker, with it's publish and subscribe mechanisms. Embedis uses a syntax similar to the popular "Redis" program, which has API/bindings available for C/C++, Python, Ruby, TCL, etc.
In this example the Embedis command interpreter is connected to the Serial Monitor (i.e. Serial.print), however we have examples that show it running several simultaneous connections at once, including Telnet, WWW, MQTT, and others.
The Embedis database is persistent, and can be used across multiple projects to configure your program settings for the specific hardware and network configuration that you are using. The Embedis database supports the internal CPU EEPROM storage by default. Embedis makes it simple to add your own storage classes and devices as well. You simply use the "select" command to select different storage devices, such as "select EEPROM" (for internel EEPROM) or "select I2CEEPROM" or "select SPIEEPROM" for externally connected storage devices.
Now, you don't need to recompile your program and reflash your device in order to change your device and project settings anymore. Project settings can be changed "on-the-fly" with just a serial or wireless interface! (some settings changes however, will require a restart/reboot to take effect.)
Embedis was developed to provide a simple, consistent command line interface and API, for storing and retrieving data from memories, sensors, interfaces, and other I/O devices, across a number of different embedded platforms and IDEs.
Installing EmbedisUse the Arduino Library Installer:
Sketch -> Include Library -> Manage Libraries
Library Manager
Under "Filter Search", enter "embedis" :
Search for Embedis
and Click on the "Install" Button:
Install
Now you can explore the Embedis examples under:
Files -> Examples -> Embedis -> Embedis
Note Bene: The default example uses EEPROM only, and will only function on boards with support for internal EEPROM (i.e. Arduino Uno/Leo/Mega/etc.), or boards with support for emulated EEPROM, such as the ESP8266. There are specific examples for boards with different capabilities, such as the Arduino Due, that do NOT include EEPROM internal to the microprocessor.
Using EmbedisThe Embedis command line interface (CLI) uses familiar SET/GET/DEL commands for storing, retriving, and deleting key-value pairs in the persistant memory stores. For example:
```
set mykey somevalue
+OK
get mykey
+somevalue
del mykey
:1
```
For more information on using Embedis, please see the -> Embedis WIKI
Embedis Development EnvironmentThe git repository includes a submodule for the testing framework and a branch 'gh-pages' for the development generated documentation. The recommended commands to use are as follows:
git clone {origin_url} embedis
cd embedis
git submodule init
git submodule update
git clone {origin_url} html --branch gh-pages
You'll need a few tools to build the tests and documentation. These are commonly tools available for all operating systems so you shouldn't have too much trouble getting them installed.
CMake can create a typical Makefile as well as project files for Xcode, Visual Studio, and many others. Here's a quick start for Makefile users:
$ cmake .
$ make && ctest
$ make doc
ContributorsThe folks who make this project possible:
- PatternAgents, LLC
- David Turnbull
- Tom Moxon
Embedis and thingSoC are community supported, you are most welcome to contribute to the project, or to help by donating to PatternAgents, who support this work.
Comments