Line 3: |
Line 3: |
| Sugarizer School Box Project is project under GSoC 2018. Mainly the project comprises of two parts : | | Sugarizer School Box Project is project under GSoC 2018. Mainly the project comprises of two parts : |
| | | |
− | 1) Creating a eSugarizer Ready Rpi Image | + | 1) Creating a Sugarizer Ready Rpi Image |
| | | |
| 2) Making one click deploy scripts to deploy sugarizer on popular VPS providers like Heroku , AWS ,GCP etc. | | 2) Making one click deploy scripts to deploy sugarizer on popular VPS providers like Heroku , AWS ,GCP etc. |
Line 37: |
Line 37: |
| script.sh is callled by rc.local at the boot , It then loads the docker images and make sugarizer_server and sugarizer_mongodb containers and run them . Once all the commands run successfully , script.sh will delete its calling command from rc.local script . If anything goes wrong or the Rpi is interrupted before the deployment , script.sh will be called again after the next boot. | | script.sh is callled by rc.local at the boot , It then loads the docker images and make sugarizer_server and sugarizer_mongodb containers and run them . Once all the commands run successfully , script.sh will delete its calling command from rc.local script . If anything goes wrong or the Rpi is interrupted before the deployment , script.sh will be called again after the next boot. |
| | | |
− | '''Note:''' Keep the rpi running for atlst an hour after the first boot . Docker Container takes sometime before start working. After the successful first boot , sugarizer server will be active in a minute or two after booting. | + | '''Note:''' Boot the pi , After 30-35mins pi will reboot automatically.After the successful first boot , sugarizer server will be active in a minute or two after booting. |
| | | |
| ===== Wifi Hotspot ===== | | ===== Wifi Hotspot ===== |
| To make the task easy , we have used a project [https://github.com/quangthanh010290/RPI3_HOTSPOTS] already available on github to setup hotspot and bridging ethernet on rpi.The wifi now works perfectly for the first run but stops throwing an IP after a reboot , its a known issue dhcpcd and hostapd . To overcome this all we need to do is restart services , so we have added a command to rc.local to restart all the required services at boot. A more deatiled explanation is as follows , we now clones the project in to /home/pi/RPI3_HOTSPOT . After the boot , a script finds the ethernet device name of the pi and replace every occurence of eth0 in the cloned project with that device name to make sure that brdiging is done correctly. At the end , script runs the ap command and we have hotspot up and working. | | To make the task easy , we have used a project [https://github.com/quangthanh010290/RPI3_HOTSPOTS] already available on github to setup hotspot and bridging ethernet on rpi.The wifi now works perfectly for the first run but stops throwing an IP after a reboot , its a known issue dhcpcd and hostapd . To overcome this all we need to do is restart services , so we have added a command to rc.local to restart all the required services at boot. A more deatiled explanation is as follows , we now clones the project in to /home/pi/RPI3_HOTSPOT . After the boot , a script finds the ethernet device name of the pi and replace every occurence of eth0 in the cloned project with that device name to make sure that brdiging is done correctly. At the end , script runs the ap command and we have hotspot up and working. |
| + | |
| + | '''Local DNS''' |
| + | |
| + | We have modified the existing wifi ap scripts to change subnet of IPs assigned to 10.x.x.x , to handle DNS requests for "server.sugarizer.org","try.sugarizer.org" and "sugarizer.org" locally. We have used dnsmasq to implement this. |
| + | |
| + | '''Exposing Port 80 using Nginx''' |
| + | |
| + | We have used Nginx as reverse proxy server to forward incoming requests of port 80 to 8080. |
| + | |
| + | '''SD card corruption Prevention''' |
| + | |
| + | To prevent sd card corruption we tried reducing the disk writes.The main cause of frequent disk writes is system logging , we have mounted /var/log as tmpfs which reduces writes to disks . |
| | | |
| ===== Building and Flashing the RPi Image ===== | | ===== Building and Flashing the RPi Image ===== |