#!/bin/bash

#   Copyright (C) 2018 by Andy Uribe CA6JAU 

# Configure latest version
FW_VERSION="v1.5.2"

sudo systemctl stop pistar-watchdog.service > /dev/null 2>&1;
sudo systemctl stop mmdvmhost.service > /dev/null 2>&1 && sleep 2 > /dev/null 2>&1 ;
 
  

# Upload the firmware
#eval sudo ./STM32F10X_Lib/utils/rpi32/stm32flash -v -w nano_hotspot_fw_1.5.2.bin -g 0x0 -R -i 200,-3,3:-200,3 /dev/ttyAMA0;
#200 -->> 203
#3-->> 6
eval sudo ./STM32F10X_Lib/utils/rpi32/stm32flash -v -w mmdvm_hs_dual_hat_fw_v1.5.2.bin -g 0x0 -R -i 203,-6,6:-203,6 /dev/ttyAMA0;

#sudo mount -o remount,ro /

sudo systemctl start pistar-watchdog.service# > /dev/null 2>&1
sudo systemctl start mmdvmhost.service > /dev/null 2>&1 && sleep 2 > /dev/null 2>&1
