Skip to content

MagOD Wiki

Leon Abelmann edited this page Jun 21, 2021 · 4 revisions

How to download code

You basically have two options to get code: download in a zipfile or clone the repository. Both can be achieved by pressing the green "Code" button on the MagOD main page.

How to select your system

The code is run by different systems, you need to make sure the correct calibration is used. Open the file MagOD.h in a plain text editor (notepad e.g.). At the top of the file you will find a list of systems. Outcomment yours (e.g. I out-commented my system at KIST here.

/* Define which system you compile for, outcomment only one */
//#define _CEA
//#define _BAYREUTH
//#define _ASTON
#define _KIST
//#define _KIST_1 // MagOD1 system

How to set Wifi

The SSID and password of the Wifi network are stored in a file password.h in the root directory (same directory as were you find MagOD.h). For obvious security reasons, this file is not on GitHub, and you will have to make it. Use your favourite text editor, and start a new file. In that file, enter two lines:

const char* ssid = "MySSID";             //WiFi network name (SSID)
const char* password = "12345";     //WiFi Password

Replace MySSID and 12345 with the network name and password of your situation (the quotes should be there). Save the file as password.h (small caps).

Instructions for compilation and upload

To compile and upload the code to the MagOD measurement box you will need the Arduino IDE, which you can download here. The ESP32 microprocessor installed in the MagOD is not a standard board for the Arduino IDE (obviously), but is fully supported. Installation is simple and described nicely here. Select Tools\Board\ESP32 Arduino\ESP32 Dev Module. Open Tools\Port and note down the devices you see there. Connect the ESP32 microprocessor inside MagOD measurement box (access just above the micro-SD card) with a USB port on your computer. The new item appearing under 'Tools/Port' is the MagOD, select that port.

In the Arduino IDE, open the file MagOD.ino. Select menu item Sketch\Upload. If correct, the code is compiled and uploaded to the MagOD. The process has finished correctly if the info bars says Done uploading. In case of trouble, copy the error messages and mail Leon.

Instructions for accessing the SD over Wifi

On the MagOD a rudimentary FTP (File Transfer Protocol) server is implemented. A nice program to read and write files is FileZilla. In FileZilla, got to menu item Site Manager and create a new site (top left button below). You will need to enter the internet address. This appears for a second or two when you switch on the MagOD (white screen). Write down the IP address (or take a photo) and enter it under 'Host: ' in FileZilla. The username is esp32, the password esp32. Encryption should be set to Only use plain FTP. Press connect. In the right panel you should get the contents of the SD card after a while.