Welcome to the MVP3000 ESP32/ESP8266 repository, an integral part of the MVP3000 rapid prototyping framework.
The MVP3000 framework is written for and by very early stage startup projects/companies. It aims to streamline the development and testing of new sensor or manipulation hardware and the consecutive transfer from the basic concept to a minimum viable product (MVP), a demonstrator device, or an independent setup for applications like manufacturing process control. It is build around readily available low-cost hardware and open software solutions.
A key feature of the framework is the seamless transition between the different development stages. Starting with the initial proof-of-concept script on the engineers laptop with a serial connection to perform first data analysis, moving to a laptop-independent data collection via wireless network allowing longer-term studies, towards a control device using a handheld Raspberry Pi with touchscreen.
More code will be shared in the future, mainly regarding data evaluation and setting up a MVP using a RaspberryPi with touch display.
To install MVP3000 as Arduino library please clone or download the main branch of this repository and follow the instructions for either manual installation, using the Arduino IDE, or in PlatformIO.
A listing in the library managers of PlatformIO and Arduino is targeted for a future release.
A good starting point is the basic example. It does not include any module, and thus is not very useful beyond testing.
Compile a copy of the sketch and listen to the serial port using your IDE (baud rate: 115200). The serial output will look like this, with a time stamp, the log category, and the actual message:
0d 00:00:00 [I] Logger initialized.
0d 00:00:00 [I] Led timing changed to: 0 ms
0d 00:00:00 [W] File not found for reading: /cfgNet.json
0d 00:00:00 [I] AP started: device13061407, 192.168.4.1
0d 00:00:00 [W] File not found for reading: /cfgNetCom.json
0d 00:00:00 [W] File not found for reading: /cfgNetMqtt.json
0d 00:00:00 [I] Led timing changed to: 2000 ms
0d 00:00:02 [U] This text will be printed in purple to Serial and the log-websocket.
...
The ESP opens an access point. Connect to it with your computer and open its IP with your web browser to access the web interface.
Use the WebSocket log example to view the log output in a browser.
As a next step proceed with using one of the modules.
The LED indicates the device status:
The main page prints basic system information and the most recent log entries. It links to the configuration options, as described in the following, and also lists the loaded modules.
For more information on MQTT and developer resources visit Eclipse Paho.
Typical use cases are available as modules to be loaded into the framework. First steps, examples, and options are given in the documentation of the respective module.
Any implementation of the framework typically follows the sequence: user code -> module code -> framework code, as in the following.
#include <MVP3000.h>
extern MVP3000 mvp;
// Xmodule code
void setup() {
// User code
// Xmodule code
mvp.setup();
}
void loop() {
// IMPORTANT: do not use blocking delay() on ESP
// User code
// Xmodule code
mvp.loop();
}
On ESP it is important to not use the blocking delay or while anywhere in the loop. This will impair the performance of the ESP, particularly the responsiveness of the network. As such it may significantly degrade the performance of the web interface and the output via WebSockets and MQTT.
Alternatives are to use the built-in LimitTimer or a custom method to wait using a timestamp variable.
The logger can be used to send message to serial and the websocket.
mvp.log("This text will be timestamped and then printed to serial in purple and to the log-websocket.");
The serial output is color-coded using ANSI escape sequences. If your serial monitor does not support this feature (Arduino IDE) it can be turned off to omit the symbols.
mvp.logAnsiColor(false);
The framework uses UDP auto-discovery to find local servers. In case this interferes with your code it can be completely turned off.
mvp.udpHardDisable();
Please see also the available Helper Functions and Classes.
Most users will not need to create a custom module, particularly if a similar one already exists. We are happy to help implementing a missing feature.
In order to develop and integrate a new module into the MVP 3000 framework please follow the documentation to Custom Modules.
We are looking forward to your input on this project, be it bug reports, feature requests, or a successful implementation that does something cool. In the latter case we will gladly link you.
Please follow the GitHub guide on how to contribute code to this project.
Q: I have problems accessing the web interface A: Are you on the same WiFi network as the device? Do you have the correct IP, it is displayed in the serial log during startup.
Q: The web interface sometimes takes forever to respond. A: Please check if there is any blocking delay or while in the loop. This significantly impairs user experience of all network related features on any ESP. Also check the libraries you use, particularly the sensor libraries often wait for the sensor to become ready.
Q: Some settings in my custom code are ignored?
A: The value set during compile time is overwritten by stored values (if stored) during initialization. Possibly factory reset the device.
Licensed under the Apache License. See LICENSE for more information.
Copyright Production 3000