element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Industrial Automation
  • Technologies
  • More
Industrial Automation
Blog AVNET SmartEdge IIOT Gateway: the 2020 Linux Image and IoTConnect Scripts
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Industrial Automation to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: Jan Cumps
  • Date Created: 11 Dec 2020 12:32 AM Date Created
  • Views 7542 views
  • Likes 6 likes
  • Comments 55 comments
  • raspberry
  • avnet
  • smartedge
  • smartedge iiot gateway
  • iiot gateway
  • linux
Related
Recommended

AVNET SmartEdge IIOT Gateway: the 2020 Linux Image and IoTConnect Scripts

Jan Cumps
Jan Cumps
11 Dec 2020

AVNET published an updated image for the SmartEdge IIOT GatewaySmartEdge IIOT Gateway.

Not a huge leap. It's still Raspbian GNU/Linux 9 (Stretch).

There are some improvements and changes worth updating for. The most important reason is the improved stability.

 

image

 

Some highlights:

  • The CAN driver got an update. There were issues after every other reboot with the original image.
  • It's now safe to call reboot without risk of bricking the device
  • It's safe to upgrade Linux on the device.

 

How to upgrade?

 

edit: avnet released an upgrade script: https://github.com/Avnet/avtse-iiotg-upgrade.

This is easier than the "from image" explanation below.

 

The SmartEdge is family of the Raspberry Pi Compute. You use a rpiboot to load an image.

I noticed that with my device, the Windows and Linux rpiboot didn't work.

If I build the AVNET version from source on a Linux (virtual) machine, it works.

 

sudo apt install libusb-1.0-0-dev

git clone https://github.com/Avnet/smartedge-iiot-gateway-custom.git
cd smartedge-iiot-gateway-custom/rpiboot
make

 

check what drives are available (look for sd* devices)

lsblk

 

unplug the SmartEdge, open it, connect the internal USB to your PC.

check that the jumper next to the USB connector is mounted.

 

sudo ./rpiboot

 

provide power to the SmartEdge

check what drives are added (look for new sd* devices, you should find a new sdX, sdX1 and sdX2)

lsblk

 

You can now use the dd utility to move the image to the SmartEdge (replace the X with the new device that appeared when running lsblk the 2nd time):

sudo dd if=avtse-iiotg-v11-20200326.img of=/dev/sdX

 

 

ntewinkel adds these parameters to see progress and get higher throughput:

bs=4M status=progress

 

Just before finishing, place an empty file called ssh on the boot partition. This will allow you to connect over an ssh terminal (e.g.: PuTTy) as soon as the device is set up. It saves you from having to go find a QUERTY keyboard and monitor.

 

Then you can unplug the USB cable,power cycle the SmartEdge, and use the AVNET's IoTConnect app to set the WiFi. I had to remove the existing device in the app, before searching for the "new" device.

 

The IoTConnect Integration

 

The SmartEdge image installs some services that make it interact with AVNET IoTConnect cloud service.

You get a 30 day subscription when registering your application with the app.

It's worth checking this out, and to try extend the examples.

The example is elaborate right out of the box. It will by default exchange the die temperature. If you attach SmartSensor devices to USB or RS-485, it will initiate those and try to exchange their data too.

You can enable the use of the DIGIO input pins, and exchange their status too.

I will write an article to investigate the scripts for cloud service and other SmartEdge specific services.

 

When not using the IoTConnect services:

 

If you used the original image before, you will have noticed that there are some changes in the way the AVNET IoTConnect scripts are started, and how the device specific hardware is handled in this version

In the first image, more was done in the rc* scripts. All has moved to system services now.

 

If you want to use the device in the intranet, or use another cloud service, it makes sense to disable the services.

This will free the following resources:

  • the custom LED is now available for your own program
  • the device doesn't connect to the internet every so many seconds
  • the I/O pins are pristine.
  • no traffic to RS-485

 

Easiest way: I disabled following services, by navigating to /etc/systemd/system and renaming them from *.service to *.bak:

  • iotconnectservice (connect to AVNET IoTConnect and run the demo)
  • ledservice (control the user LED, attention, also entertains the watchdog)
  • quectel (keep GSM modem connection alive. My box doesn't have the modem)
  • smartedgehalt  (part of the user LED functionality)

None of these changes are impacting. You can rename them back to *.service and you have the demo functionality back.

I left the services related to the reset button and watchdog running.

 

I commented out 2 lines in the reboot script, related to the user LED.

The script makes the led flash fast, and after reboot, that's normally stopped by the ledservice.

If we leave the two lines of code in, we have a flashing LED after reboot.

 

sudo nano /opt/avnet-iot/iotservices/reboot

 

Then at the end, put a # in front of the LED commands:

 

# echo 20 > /sys/class/leds/smartedge_led/brightness
# echo 128 > /sys/class/leds/smartedge_led_duty/brightness

 

 

A little harder but cleaner method: the proper way to disable the services is actually, for each service, stop and disable them.

There is some more work to it, because some of the scripts re-enable services (watchdog stopwd script tries to restart smartedgehalt.service).

If you want to do the exercise by disabling services instead of the rename "hack",

don't rename the .service files to .bak files, and follow instructions below:

 

sudo systemctl stop iotconnectservice.service
sudo systemctl disable iotconnectservice.service
sudo systemctl stop ledservice.service
sudo systemctl disable ledservice.service
sudo systemctl stop quectel.service
sudo systemctl disable quectel.service
sudo systemctl stop smartedgehalt.service
sudo systemctl disable smartedgehalt.service

 

 

Then make the same change to the reboot script as described above.

 

Then similar for the halt script, comment out the line that makes the red let blink at reboot:

 

sudo nano /opt/avnet-iot/iotservices/halt

 

# echo 36 > /sys/class/leds/smartedge_led/brightness

 

And in the stopwd script, prevent that the smartedgehalt.service gest re-enabled:

 

sudo nano /opt/avnet-iot/iotservices/stopwd

 

# systemctl enable smartedgehalt

 

Whether you used the 1st or 2nd method, the result is that the IoTConnect extensions aren't started at boot or reboot, and the red led is no longer used for signaling device / service specific statuses.

Watchdog and reboot service are still active.

 

Other Changes, Watch outs

 

You can now reboot without issues. The Linux default reboot command now points to /opt/avnet-iot/iotservices/reboot.

The reset button works better. A short press calls the above reboot script. A long press (> 10 seconds) resets to factory.

Attention when using the WatchDog service (when you put the watchdog jumper). The Led Service has to run too, because it stops the watchdog and prevents a reboot.

 

The initial image release could become unstable when performing an upgrade.

The user documentation contains the measures to take to avoid this. But at the end of the document, in an addendum.

The new image has these actions taken for you:

$ apt-mark showhold
raspberrypi-bootloader
raspberrypi-kernel
raspberrypi-sys-mods

 

The server isn't recognised by its name on my network. I had to install avahi for that:

sudo apt-get install avahi-daemon

Once that command executed the smartedge published the name it was given in the raspi-config utility.

 

In a later post I'll untangle how the different AVNET services work together.

 

Related Blog
Industrial I/O
Use the Industrial I/O
Control Industrial I/O directly from GPIO Pins
C Program for the Industrial I/O
Control Industrial I/O directly from Node-RED
Display Industrial I/O on Node-RED Dashboard
CAN Bus
Use the Isolated CAN
CAN programming in C on Linux: Filter and Mask
2020 Linux Image
The 2020 Linux Image and IoTConnect Scripts
Understand the Custom Scripts and Services (Pt. 1: intro and reset button service)
Understand the Custom Scripts and Services (Pt. 2: led service)
Understand the Custom Scripts and Services (Pt. 3: IoT Connect service)
  • Sign in to reply

Top Comments

  • Jan Cumps
    Jan Cumps over 4 years ago in reply to ntewinkel +2
    ntewinkel wrote: .... You said that after disabling the services: "> the I/O pins are pristine." Does that mean all of the regular Raspberry Pi pins are useable then? For example, I could hook it up to…
  • Jan Cumps
    Jan Cumps over 4 years ago in reply to ntewinkel +2
    avnet released an upgrade script: https://github.com/Avnet/avtse-iiotg-upgrade I read it but haven't tested. Way easier than starting from fresh image.
  • ntewinkel
    ntewinkel over 4 years ago in reply to Jan Cumps +2
    I see their documentation hasn't improved any. They might have added a few extra notes and guidance into that github readme! side-note, looks like a version 1.3 is in progress too. Best, -Nico
Parents
  • ntewinkel
    ntewinkel over 4 years ago

    Bit of an update note: Avnet released a new version of the app just a few weeks ago (Feb 2021), which requires the firmware to be updated.

     

    I just re-flashed with the v11 image, but when I tried to provision it to my WiFi network, it gave me this message:

    image

     

    I followed those instructions, and it's running the script updates right now. I'll check back in after it has completed.

     

    ps, it seems that ssh is refused until after the SmartEdge has been provisioned with the app. I had remembered to copy the ssh file, and even tried using raspi-config to enable it too.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • ntewinkel
    ntewinkel over 4 years ago in reply to ntewinkel

    Dangit... I could've just flashed with the new v1.3 firmware! I see it was just recently added to their downloads (following your url above)

    image

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • ntewinkel
    ntewinkel over 4 years ago in reply to ntewinkel

    Dangit... I could've just flashed with the new v1.3 firmware! I see it was just recently added to their downloads (following your url above)

    image

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
  • Jan Cumps
    Jan Cumps over 4 years ago in reply to ntewinkel

    ntewinkel  wrote:

     

    Dangit... I could've just flashed with the new v1.3 firmware! I see it was just recently added to their downloads (SmartEdge Industrial IoT Gateway Solution - Connects to Innovate )

    image

    Are you going to try it out?

    I'm in the middle of something, not going to upgrade now. Once that 's finished, I might backup my current image, and try it out ...

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • ntewinkel
    ntewinkel over 4 years ago in reply to Jan Cumps

    Jan Cumps  wrote:

    Are you going to try it out?

     

    I was going to trust that the script did the trick. There's a good chance I'll screw something up and have to reflash though image

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Jan Cumps
    Jan Cumps over 4 years ago in reply to ntewinkel

    ntewinkel  wrote:

     

    Jan Cumps   wrote:

    Are you going to try it out?

     

    I was going to trust that the script did the trick. There's a good chance I'll screw something up and have to reflash though image

    I think that the script mentioned in the app doesn't upgrade the OS, just the custom AVNET cloud demo and modules.

    I'm going to check...

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • ntewinkel
    ntewinkel over 4 years ago in reply to Jan Cumps

    Jan Cumps  wrote:

     

    I think that the script mentioned in the app doesn't upgrade the OS

     

    Most likely the case yes.

    So that will also take extra in my case. Ultimately faster to just flash with v1.3 to start with!

    But oh well, think of all the experience I'm gaining by doing everything 10 times image

     

    ps, I noticed the app now shows extra "sensors", including input values for all the DIGIO inputs.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • ntewinkel
    ntewinkel over 4 years ago in reply to Jan Cumps

    I just reflashed with the v1.3 image. looks like version 4.14.79 from July 16, 2019:

     

    avnet@raspberrypi:~ $ uname -a

    Linux raspberrypi 4.14.79-v7+ #91 SMP Tue Jul 16 05:42:32 PDT 2019 armv7l GNU/Linux

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube