|
8 | 8 |
|
9 | 9 |  |
10 | 10 |
|
11 | | -1. Cut PCB to the right size if neccessary. |
| 11 | +1. Cut PCB to the right size if necessary. |
12 | 12 | 2. Drill two mounting holes into PCB to fit the board at the end of the case. |
13 | | -3. Solder the componentes onto PCB (daughterboard). |
14 | | -4. Screw Arduino with shield and spacers into case (saw spacers to the right length in neccessary). |
15 | | -5. Install daughterboard. |
16 | | -6. Wire daughterboard to Arduino. |
| 13 | +3. Solder the components onto PCB (daughter board). |
| 14 | +4. Screw Arduino with shield and spacers into case (saw spacers to the right length in necessary). |
| 15 | +5. Install daughter board. |
| 16 | +6. Wire daughter board to Arduino. |
| 17 | +7. Next steps: [install software](#installing-software). |
17 | 18 |
|
18 | | - |
| 19 | + |
19 | 20 |
|
20 | 21 | ## Installing software |
21 | 22 |
|
| 23 | +### Installation steps |
| 24 | + |
| 25 | +1. Deploy website on [SD card](#deploy-website-on-sd-card-default) or on [external webserver](#deploy-website-on-external-webserver-recommended) |
| 26 | +2. Connect Arduino to a powered on PC via USB and the shield to a router via ethernet. |
| 27 | +3. Open router configuration, set a static IP range and choose a free IP address. |
| 28 | +4. Set the IP address in the `src.ino` file and save (skip this step when already done in a previous step). |
| 29 | +5. Open Arduino IDE and upload `src.ino` to Arduino. |
| 30 | +6. Test if the website can be reached by typing the IP into the web browser (skip this step when already done in a previous step). |
| 31 | +7. Unplug all the cables from the Arduino for the next steps. |
| 32 | +8. Next steps: [Install into PC](#installing-into-pc). |
| 33 | + |
| 34 | +### Website deploy options |
| 35 | + |
| 36 | +Website can be deployed on SD card of the ethernet shield or on a dedicated webserver. |
| 37 | + |
| 38 | +Recommended way is to deploy the website on a dedicated webserver due to problems with the SD card initialization. Sometimes the SD card does not initialize on startup, pulling the SD card out and pushing it in again helps. But this is not a viable solution when the arduino is installed inside a PC. |
| 39 | + |
| 40 | +#### Deploy website on SD card (default) |
| 41 | + |
22 | 42 | 1. Format SD card to FAT16 with [SDcard formatter (recommended)](https://www.sdcard.org/downloads/formatter/) |
23 | 43 | 2. Store website (content of `web/src/`) on SD card. |
24 | 44 | 3. Put SD card into ethernet shield. |
25 | | -4. Connect Arduino to a powerd on PC via USB and the shield to a router via ethernet. |
26 | | -5. Open router configuration, set a static IP range and choose a free IP address. |
27 | | -6. Set the IP address in the `src.ino` file and save. |
28 | | -7. Open Arduino IDE and upload `src.ino` to Arduino. |
29 | | -8. Test if the website can be reached by typing the IP into the webbrowser. |
30 | | -9. Unplug all the cables from the Arduino for the next steps. |
| 45 | + |
| 46 | +#### Deploy website on external webserver (recommended) |
| 47 | + |
| 48 | +1. In `server/src/src.ino` |
| 49 | + |
| 50 | +- Comment out `#define WEBSITE_ON_SD_CARD` |
| 51 | +- Comment in `#define WEBSITE_ON_EXTERNAL_WEBSERVER` |
| 52 | +- Set the IP address in the `src.ino` file and save. |
| 53 | + |
| 54 | +2. Create a directory on your server e.g. `remote-switch` and copy `web/src/config.json` to it |
| 55 | + |
| 56 | +- `mkdir remote-switch` |
| 57 | + |
| 58 | +3. In `remote-switch/config.json` |
| 59 | + |
| 60 | +- Set the `apiUrl` constant to the IP address of the arduino ethernet shield |
| 61 | +- (optional) Change the `title` |
| 62 | + |
| 63 | +3. Deploy the webserver using docker |
| 64 | + |
| 65 | +- `cd` into `remote-switch` directory |
| 66 | +- docker run -p 80:80 -v ./config.json:/usr/share/nginx/html/config.json ghcr.io/matiasg19/arduino-remote-switch:latest |
| 67 | + |
| 68 | +4. Test if the website can be reached by typing the IP into the web browser. |
31 | 69 |
|
32 | 70 | ## Installing into PC |
33 | 71 |
|
|
37 | 75 | 4. Connect Arduino to the USB header. |
38 | 76 | 5. Connect the shield to ethernet to router. |
39 | 77 | 6. Restore power to PC again. Arduino should turn on. |
40 | | -7. Open webbrowser on phone to open the website and turn on PC by pressing the power on button. |
| 78 | +7. Open web browser on phone to open the website and turn on PC by pressing the power on button. |
41 | 79 | 8. PC should start. |
42 | 80 |
|
43 | 81 |  |
0 commit comments