Serial Service Menu

Serial Service Menu © GPL3+

Show status information, change NW credentials, ping your gateway, show sensor values or get more details by activating debugging…

  • 6,052 views
  • 2 comments
  • 20 respects

Components and supplies

Mkr wifi 1010 usibb9nl4v
Arduino MKR WiFi 1010
Will run on all SAMD21 Boards (MKRs) and probably also on all the other/older Arduinos…
×1
19c7994 40
Tactile Switch, Top Actuated
The 'factory reset' push button...
×1

Apps and online services

Ide web
Arduino Web Editor
Because it's the easiest way to get your IoT Project started fast :-)
putty - for Windows and Linux
Serial terminal client program, written by Simon Tatham, Alexandra Lanes, Ben Harris and Jacob Nevins
Serial USB Terminal - for Android Phones
Serial terminal client program, written by Kai Morich

About this project

Motivation

When I handover Arduino IoT projects to friends I realize that I need to address the following requirements:

  • Various network credentials must be changeable by others without an IDE. Here some examples: SSID/Key for WiFi, APN/Pin/UN/PW for GSM, APP_EUI/KEY for LoRa-WAN, etc.)
  • A Hostname byside the THING_ID would be useful.
  • The Serial-Line is slow by design and therefore I avoid printing out unnecessary information's. But in kind of troubles it must be possible to activate serial debugging. And of course, without restarting the Arduino - to avoid that the reboot temporary fix a problem...
  • Get some general status information's out of the Arduino.

Requirements

I use various Arduino MKRs (WiFi, LoRa, GSM) because of their IoT functions. The following solutions are possible for all the MKR variants...

Storage

The SAMD21G18 Microcontroller has an on-board flash with 256KB capacity. This is more than enough to store everything for my projects. No extra hardware is needed.

There is one important fact to know: The flash will be completely erased when you upload a new Sketch. So, the settings get lost in this case. Not a showstopper for my projects. But maybe for yours!!!

The ATECC508 Chip was also a possible storage place. But because only three Slots with 72 Bytes are free - it is not a good choice for me.

User Interface

To keep it simple I selected the USB Port to interact with the user. This port is available on all Arduino's and serial terminal client programs (putty) are free available on nearly all computers and mobile devices.

To protect from unauthorized access, the serial line must be secured with a password!

Recover from lost password

If the password will be forgotten, a button to reset the flash to factory defaults is required.

The Solution

I have called it Serial Service Menu - view the video to see how it behaves...

take a look...

The communication is done by using Arduino's Micro-B USB Port yes, the same you use for uploading your sketch. In fact, a virtual RS232 serial communication channel was used.

If you like to connect your mobile device, you need an OTG (On the Go) Ready Smartphone and an OTG adapter cable. It is the short cable directly connect to my phone. This Cable signals the phone that it should behave as a USB host and not like a USB Client which it normally does. As Host you can connect USB Devices like a USB Stick into your phone or get use of virtual USB COM Ports as we need here.

The Arduino acts as Terminal Server and on the other side the PC/MAC/Mobile-Phone needs to run a Terminal Client program. This client used the virtual COM Port which appears when you connect the Arduino to your PC.

I recommend using putty as terminal client for PCs and Linux systems. For Android Phones I recommend the Serial USB Terminal App from Kai Morich. It's in the Play-Store. Because I am not an Apple user I cannot recommend terminal client apps for MACs or iPhones - sorry. But there are good programs available for the Apple world too!

Beside the Arduino MKR you only need a push button for the factory reset function. This is necessary when the user losts his password! The factory reset button was only checked once during the Arduino startup (void setup()) so you can also reuse an already existing button from your project!

The Sketch

See the section CODE below for the complete Arduino sketch. I have documented a lot inside the code. But let me explain some details right away:

1. I have connected and used one SHT35 Temperature and Humidity Sensor to demonstrate a possible task/job for the MKR. This has nothing to do with the Serial Service Menu, it is just an example.

2. The SHT35 values are presented by the Arduino IoT Dashboard, again just for demonstration purposes.

3. There is also a dashboard button to reset the Arduino from remote. Maybe this is also interesting for you...

When you push the "RestartCpu" button you can reboot your Arduino MKR from remote. You can watch the restart by entering the debug mode on the Serial Service Menu...

restart from dashboard

I also wrote three flowcharts for the three main code parts in the sketch. You will find them below. Use them together with the notes inside the sketch to get familiar...

Code

Serial Service Menu
The Serial Service Menu sketch...

Schematics

MKR WiFi 1010
The Arduino MKR microcontroller I used for this project...
Schematic gvjfw3dg2a
void start()
Implements the factory reset and initial setup dialog logic...
Void start pykwitdpun
void loop()
Ask for a password, displays the menu and all submenus and other related functions...
Void loop hcukdaqrbx
serial receive function
The part of the code (Ser_Rx) which receives, interprets and echoes all incoming characters on the serial interface (usb port).
Ser rx 7eegd1okyl

Comments

Author

Andreas waldherr
andreas_waldherr
  • 2 projects
  • 6 followers

Additional contributors

Published on

October 6, 2020

Members who respect this project

Avatar fofgrbxpcz15492331 351560078550761 73659207954869482 nDuminyrDefaultAdambenzDefaultDefaultDefault

and 12 others

See similar projects
you might like

Similar projects you might like

Six-Button Menu Configuration

Project showcase by danhostler1985

  • 5,679 views
  • 2 comments
  • 3 respects

Bluetooth Low Energy: Subscription to a Service

Project tutorial by Avilmaru

  • 3,125 views
  • 0 comments
  • 2 respects

A Simple Arduino Menu With An LCD

by Ian Cumming

  • 121,415 views
  • 38 comments
  • 53 respects

View Serial Monitor Over Bluetooth

by millerman4487

  • 42,157 views
  • 13 comments
  • 40 respects
Add projectSign up / Login