Good way to create a backup  copy of a micromite program


Author Message
Vampire05
Regular Member

Joined: 06/12/2020
Location: Germany
Posts: 88
Posted: 12:47pm 03 Apr 2021      

Hi guys,
I think I have a smart idea for backup from CMM2, Micromite and other MCUs. I am trying this out at the moment.

My idea is to make a backup over the internet/network:

First the CMM2 needs internet. This is very easy to solve for this case. With an ESP32 / ESP8266 I build a SERIAL TO HTTP adapter:

The ESP listens on the UART and knows the following commands:
- Connect_to_wifi(SSID, PW): -> IP Address       // connect to your wifi
- http_get(URL): -> HTTP Response                // send a http get
- http_post(URL, BASE64_DATA): -> HTTP Response  // send a http post
- b64_encode(data): -> B64 String                // encode data to b64. easy on ESP
- b64_decode(b64_string): -> data                // decode b64 to data. easy on ESP

With this you can already communicate to the internet. An universal HTTP Client for all UART Microcontrollers  

On the other hand a very simple Python server can receive the following things :

POST: http://...server-url.../save -> {"filename": "test.bas", "filecontent": "...BASE64 DATA..."}                        //save file on server

GET: http://...server-url.../list           //list all my files

GET: http://...server-url.../load?filename=test.bas      // get the filecontent of test.bas


Now you could create a script in mmbasic, which sends the appropriate UART commands to the ESP!