diff --git a/mbed_app.json b/mbed_app.json index 5c33375..adc3b58 100644 --- a/mbed_app.json +++ b/mbed_app.json @@ -1,6 +1,6 @@ { "config": { - "tx-timer": { "value": 30000 }, + "tx-timer": { "value": 600000 }, "lora-radio": { "help": "Which radio to use (options: SX1272,SX1276)", "value": "SX1276" @@ -61,8 +61,6 @@ "main_stack_size": 1024, "target.lpticker_lptim": 0, "target.clock_source": "USE_PLL_HSI", - "lora.duty-cycle-on": false, - "tx-timer": 600000, "lora-radio": "SX1272", "lora-spi-mosi": "D11", "lora-spi-miso": "D12", diff --git a/scripts/gen_images.sh b/scripts/gen_images.sh index 7359cdc..d510446 100755 --- a/scripts/gen_images.sh +++ b/scripts/gen_images.sh @@ -13,9 +13,18 @@ if [ $# -ne 2 ]; then exit 1; fi +SED=sed MASTER=$1 DEVICES=$2 +if [[ $OSTYPE == "darwin"* ]]; then + if ! command -v gsed > /dev/null 2>&1; then + echo "You need gnu-sed on darwin system (available with homebrew)" + exit 1 + fi + SED=gsed +fi + if [ ! -e $MASTER ]; then echo "The master file $MASTER doesn't exists" exit 1; @@ -31,8 +40,8 @@ for DEVICE in $(cat $DEVICES); do deviceeui=$(echo $DEVICE | cut -d : -f 2) appeui=$(echo $DEVICE | cut -d : -f 3) appkey=$(echo $DEVICE | cut -d : -f 4) - echo $name - hexdump -ve '1/1 "%.2X"' $MASTERFILE | sed "s/$DEVICEEUI/$deviceeui/; s/$APPEUI/$appeui/; s/$APPKEY/$appkey/" | xxd -r -p > waveofhoney-${name}.bin + echo "Generating device $name ($deviceeui)" + hexdump -ve '1/1 "%.2X"' $MASTER | $SED "s/${DEVICEEUI}/${deviceeui}/; s/${APPEUI}/${appeui}/; s/${APPKEY}/${appkey}/" | xxd -r -p - ${deviceeui}.bin done exit; \ No newline at end of file