-
Notifications
You must be signed in to change notification settings - Fork 3
Home
Dominic Létourneau edited this page Jan 28, 2022
·
23 revisions
# This will create a dump/MovIt directory with all documents.
mongodump --db MovIt
# This will create an archive of the dump
tar cvzf movit_db_backup.tar.gz dump
# Extract the archive (will create the dump directory)
tar xvzf movit_db_backup.tar.gz
# Make sure backend if disabled when updating (it is using the database)
sudo systemctl stop movit_backend.service
# Drop current content of database
mongo MovIt --eval "db.dropDatabase();"
# Restore the DB (from the dump directory)
mongorestore
# Re-Start backend
sudo systemctl start movit_backend.service
# Remove MongoDB from system
sudo apt-get remove mongodb
# Cleanup database files
sudo rm -rf /var/lib/mongodb
# Re-Install MongoDB
sudo apt-get install mongodb
# Enable MongoDB
sudo systemctl enable mongodb
# Start MongoDB
sudo systemctl start mongodb
# Init MOvIT database
cd ~/MOvITPlus/MOvIT-Detect-Backend/
sudo node initDatabase.js
sudo nano /etc/hostapd/hostapd.conf
Use this config:
ctrl_interface=/var/run/hostapd
ctrl_interface_group=0
country_code=CA
interface=wlan0
driver=nl80211
ssid=Movit-NOCONF
hw_mode=a
channel=36
ieee80211d=1
ieee80211n=1
ieee80211ac=1
wmm_enabled=0
macaddr_acl=0
auth_algs=1
wpa=2
wpa_passphrase=movitplus
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP CCMP
rsn_pairwise=CCMP
Save file with CTRL-X, answer yes to save file
Then reboot:
sudo reboot
You need a keyboard / monitor for these steps.
sudo systemctl stop hostapd.service
sudo systemctl disable hostapd.service
sudo nano /etc/dhcpcd.conf
Change the last lines (wpa0 to wpa1):
interface wlan1
static ip_address=192.168.10.1/24
nohook wpa_supplicant
Save file with CTRL-X, answer yes to save file
sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
Configure with:
country=CA
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
ap_scan=1
update_config=1
network={
ssid="<ENTER SSID NAME HERE>"
psk=<ENTER PASSWORD HERE>
}
As an alternative, you can use the local browser and use the frontend to configure the WiFi client at URL : http://localhost.
sudo reboot
Once rebooted, open a terminal and type:
sudo ifconfig
To get the IP address.
You can now connect to this IP address to connect to the frontend.
sudo nano /etc/hostapd/hostapd.conf
Use this config:
ctrl_interface=/var/run/hostapd
ctrl_interface_group=0
country_code=CA
interface=wlan1
driver=nl80211
ssid=Movit-NOCONF
hw_mode=g
channel=11
ieee80211d=1
wmm_enabled=0
macaddr_acl=0
auth_algs=1
wpa=2
wpa_passphrase=movitplus
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP CCMP
rsn_pairwise=CCMP
sudo nano /etc/dnsmasq.conf
Go to the end of the file (line 685) and change the interface from wlan0 to wlan1
interface=lo,wlan1
no-dhcp-interface=lo
bind-interfaces
server=8.8.8.8
domain-needed
bogus-priv
dhcp-range=192.168.10.50,192.168.10.150,12h
sudo systemctl enable hostapd.service
sudo systemctl start hostapd.service
sudo reboot