Main page
Recent changes
Arduino MEGA 63 relay Web switch
B
I
U
S
link
image
code
list
Show page
Syntax
!!Firmware * For beginners [Getting Started with Arduino|https://arduino.cc/en/Guide/HomePage] * You can download and configure firmware from master tree [GitHub|https://github.com/dm5xx/mega_webswitch] ** '''Run''' the file '''SecuGenerator.html''' in your Browser. Choose an exactly 16 character long password and a salt value with 2-5 digits (see hints for pwd and salt generation in the file - but SecuGenerator.html has an error, use description what to store where down below) [https://remoteqth.com/img/wiki-web-sw-secugenerator1.png] ** Copy '''Key''' to the '''config.cfg''' to a variable named '''strToken''' ** Copy '''Salt''' to config.cfg''' to a variable named '''intSalt''' [https://remoteqth.com/img/wiki-web-sw-secugenerator2.png] ** Copy '''Token''' to mega_webswitch.js''' to a variable named '''secToken'''. WARNING: If your token is not valid, it says ...valid: NO :) ** edit '''config.cfg''', copy the file to the microSD card and plug it into the Ethernet shield * Download Arduino [IDE|https://www.arduino.cc/en/Main/Software] * Unzip and copy the 2 libraries Hashmap and Time to your Arduino libraries folder ( eg .../documents/ardion/libraries) ** open'''.ino''' file, compile and upload to Arduino MEGA - normally no need to change settings in the sketch if you configure the config.cfg Configure firmware - The default entries. Some of them are overwritten by config.cfg - If you want to have more than 1 webswitch active, change the mac adress. But since you are using a sd card, nothing to change in the sketch itself :P See the sketch (.ino) for info whats going on... So if everything is configured fine, you can call the MEAG 63 relay Web switch from your browser by https://<device_ip_adress>/<your_token>... Example: https://192.168.1.179/33196680 * '''mega_webswitch.css''' Change the UI only if you know what you are doing... :P * '''mega_webswitch.js''' {{var textbank0 = ["HLAVNI PWR","3525 kHz","3600 kHz","3700 kHz","3775 kHz","OMP1-[5s]","OFF-1s","OPR","OMP2-[5s]","OFF-1s","OPR","ALPHA-ON-[5s]","OFF-1s","OPR","EMTRON-ON","OPR"]; var textbank1 = ["AL80b","H8K","VN-4.2-ON-1s","VN-4.2-OFF-1s","2x400","2xGU81","4xGU81","1xGU81","SB1000","MBst-ON-[5s]","OFF-1s","Velkoz-ON-1s","OFF-1s","L4B-1","L4B-2","L4B-3"]; var textbank2 = ["QRO1","QRO2","mH-20-ON-[5s]","OFF-1s","VN-5-ON-1s","OFF-1s","vH-20v-ON-[5s]","OFF-1s","vH-20z-ON-1s","OFF-1s","MLA","AL80A","MB2-ON-[5s]","OFF-1s","MB3-ON-[5s]","OFF-1s"]; var textbank3 = ["QRO1","QRO2","mH-20-ON-[5s]","OFF-1s","VN-5-ON-1s","OFF-1s","vH-20v-ON-[5s]","OFF-1s","vH-20z-ON-1s","OFF-1s","MLA","AL80A","MB2-ON-[5s]","OFF-1s","MB3-ON-[5s]","ServerOK"]; var togglebank0 = [[1,2,3,4],[6,7],[9,10],[12,13]]; var togglebank1 = [[]]; var togglebank2 = [[]]; var togglebank3 = [[]]; var secToken = 33196680; }} This are the labels for each button per bank. togglebank0-3 are multi dymensional arrays. You can define as many groups per bank as you want. In the example, position 1,2,3,4 of bank0 are grouped together, so only one of this group can be stay on. while clicking another button of this group the other one is switched off. REMEMBER: Start counting by 0, not by 1! :P Because there is just 63, not 64, the last one of bank3 is not used... The secToken must be the same as your Key from the SecuGenerator.html and strToken in your config.cfg. It makes sense to change this Security Credentials from time to time... You need help? We are here for you... Ask DM5XX (see contact) - we will never leave you alone... ---- [<-- Web page|https://remoteqth.com/arduino-web-switch.php]
Password
Summary of changes