Skip to content

Commit

Permalink
Jbobotek esp new sample location (#1444)
Browse files Browse the repository at this point in the history
* Update setup_arduino_libraries.sh

* Update arduino-esp.yml

* Update rpi_uart_interface.py

* Update setup_arduino_libraries.sh

* Update arduino-esp.yml for Azure Pipelines

* Update esp_arduino_uart_interface.py
  • Loading branch information
jbobotek authored and jasmineymlo committed Mar 3, 2020
1 parent 94a17ae commit 7667966
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 14 deletions.
23 changes: 12 additions & 11 deletions build/arduino-esp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ jobs:
git submodule update --init --recursive
. build_all/arduino/setup_arduino_libraries.sh
#copy example and platform.local.txts to their correct locations
echo $NEWTIN | sudo -S cp -r $ARDUINO_LIBRARY_DIR/AzureIoTHub/examples/iothub_ll_telemetry_sample $ARDUINO_LIBRARY_DIR/../
echo $NEWTIN | sudo -S cp $ARDUINO_LIBRARY_DIR/AzureIoTHub/examples/iothub_ll_telemetry_sample/esp8266/platform.local.txt ~/.arduino15/packages/esp8266/hardware/esp8266/2.5.2/
echo $NEWTIN | sudo -S cp -r $ARDUINO_LIBRARY_DIR/AzureIoTHub/examples/. $ARDUINO_LIBRARY_DIR/../
echo $NEWTIN | sudo -S cp $ARDUINO_LIBRARY_DIR/AzureIoTHub/examples/esp8266/iothub_ll_telemetry_sample/platform.local.txt ~/.arduino15/packages/esp8266/hardware/esp8266/2.5.2/
displayName: 'setup libraries'
env:
IOTHUB_CONNECTION_DEVICE_STRING: $(MXCHIP_NIGHTLY_DEVICE_STRING)
Expand All @@ -25,13 +25,10 @@ jobs:
cd $(Agent.WorkFolder)
echo "work folder"
ls
cd libraries/AzureIoTUtility/src
echo "util folder"
ls
cd $(Agent.WorkFolder)/iothub_ll_telemetry_sample
cd $(Agent.WorkFolder)/esp8266/iothub_ll_telemetry_sample
echo "telem folder"
ls
arduino --upload --board esp8266:esp8266:huzzah --pref sketchbook.path=../ --port $(ESP8266_PORT) --verbose-build iothub_ll_telemetry_sample.ino
arduino --upload --board esp8266:esp8266:huzzah --pref sketchbook.path=../../ --port $(ESP8266_PORT) --verbose-build iothub_ll_telemetry_sample.ino
# should fail job if build/upload fails
displayName: 'build and upload'
env:
Expand Down Expand Up @@ -68,8 +65,8 @@ jobs:
git submodule update --init --recursive
. build_all/arduino/setup_arduino_libraries.sh
#copy example and platform.local.txts to their correct locations
echo $NEWTIN | sudo -S cp -r $ARDUINO_LIBRARY_DIR/AzureIoTHub/examples/iothub_ll_telemetry_sample $ARDUINO_LIBRARY_DIR/../
echo $NEWTIN | sudo -S cp $ARDUINO_LIBRARY_DIR/AzureIoTHub/examples/iothub_ll_telemetry_sample/esp32/platform.local.txt ~/.arduino15/packages/esp32/hardware/esp32/1.0.2/
echo $NEWTIN | sudo -S cp -r $ARDUINO_LIBRARY_DIR/AzureIoTHub/examples/. $ARDUINO_LIBRARY_DIR/../
echo $NEWTIN | sudo -S cp $ARDUINO_LIBRARY_DIR/AzureIoTHub/examples/esp32/iothub_ll_telemetry_sample/platform.local.txt ~/.arduino15/packages/esp32/hardware/esp32/1.0.2/
displayName: 'setup libraries'
env:
IOTHUB_CONNECTION_DEVICE_STRING: $(MXCHIP_NIGHTLY_DEVICE_STRING)
Expand All @@ -81,9 +78,13 @@ jobs:
NEWTIN: $(NEWTIN)
- script: |
cd $(Agent.WorkFolder)
echo "work folder"
ls
cd $(Agent.WorkFolder)/esp8266/iothub_ll_telemetry_sample
echo "telem folder"
ls
cd $(Agent.WorkFolder)/iothub_ll_telemetry_sample/
arduino --upload --board esp32:esp32:esp32 --port $(ESP32_PORT) --pref sketchbook.path=../ --verbose-build iothub_ll_telemetry_sample.ino
arduino --upload --board esp32:esp32:esp32 --port $(ESP32_PORT) --pref sketchbook.path=../../ --verbose-build iothub_ll_telemetry_sample.ino
# should fail job if build/upload fails
displayName: 'build and upload'
env:
Expand Down
9 changes: 7 additions & 2 deletions build_all/arduino/setup_arduino_libraries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
cd $STAGING_DIR
echo $NEWTIN | sudo -S rm -r azure-iot-pal-arduino
git clone https://github.com/Azure/azure-iot-pal-arduino.git
git clone -b update-sample-tree https://github.com/Azure/azure-iot-pal-arduino.git

cd azure-iot-pal-arduino
echo "copying sdk sources path to pal layer now"
Expand All @@ -15,7 +15,12 @@ python3 make_sdk.py -o $ARDUINO_LIBRARY_DIR

# input WIFI_SSID, WIFI_PWD, and IOTHUB_CONNECTION_DEVICE_STRING into iot_config.h

cd $ARDUINO_LIBRARY_DIR/AzureIoTHub/examples/iothub_ll_telemetry_sample/
cd $ARDUINO_LIBRARY_DIR/AzureIoTHub/examples/esp8266/iothub_ll_telemetry_sample/
echo $NEWTIN | sudo -S sed -i 's/your-wifi-name/'$WIFI_SSID'/g' iot_configs.h
echo $NEWTIN | sudo -S sed -i 's/your-wifi-pwd/'$WIFI_PWD'/g' iot_configs.h
echo $NEWTIN | sudo -S sed -i 's@your-iothub-DEVICE-connection-string@'$IOTHUB_CONNECTION_DEVICE_STRING'@g' iot_configs.h

cd $ARDUINO_LIBRARY_DIR/AzureIoTHub/examples/esp32/iothub_ll_telemetry_sample/
echo $NEWTIN | sudo -S sed -i 's/your-wifi-name/'$WIFI_SSID'/g' iot_configs.h
echo $NEWTIN | sudo -S sed -i 's/your-wifi-pwd/'$WIFI_PWD'/g' iot_configs.h
echo $NEWTIN | sudo -S sed -i 's@your-iothub-DEVICE-connection-string@'$IOTHUB_CONNECTION_DEVICE_STRING'@g' iot_configs.h
2 changes: 1 addition & 1 deletion testtools/UART_interface/esp_arduino_uart_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class esp_uart_interface(uart_interface):
messages_sent = 5

def check_sample_errors(self, line):
if "Confirm Callback" in line:
if "Confirmation callback" in line:
self.message_callbacks += 1

# If there is a sudden disconnect, program should report line in input script reached, and close files.
Expand Down

0 comments on commit 7667966

Please sign in to comment.