Install software:

opkg update
opkg install snmp-utils
opkg install snmpd 
/etc/init.d/snmpd enable
/etc/init.d/snmpd restart

Setup snmpset:

nano /mnt/sda1/snmp.sh
#!/bin/ash
snmpset -v 2c -c private 127.0.0.1 iso.3.6.1.2.1.31.1.1.1.18.1 s $1 2>/dev/null
chmod 755 /mnt/sda1/snmp.sh

Test snmpset:

root@Arduino:/mnt/sda1# /mnt/sda1/snmp.sh 70
iso.3.6.1.2.1.31.1.1.1.18.1 = STRING: "70"

Confirm with snmpget:

snmpget -v 2c -c public 127.0.0.1 iso.3.6.1.2.1.31.1.1.1.18.1  2>/dev/null

ATmega32u4 code:

#include <Process.h>
int temperature;
void setup() {
  Bridge.begin();  // Initialize Bridge
}
void loop() {
  temperature = 70 + random(0, 10);
  Process p;
  p.begin("/mnt/sda1/snmp.sh");
  p.addParameter(String(temperature));
  p.run();
  delay(5000);
}

Confirm receive data from ATmega32u4:

root@Arduino:/mnt/sda1# snmpget -v 2c -c public 127.0.0.1 iso.3.6.1.2.1.31.1.1.1
.18.1  2>/dev/null
iso.3.6.1.2.1.31.1.1.1.18.1 = STRING: "77"



Comments (0)

    Attach images by dragging & dropping or by selecting them.
    The maximum file size for uploads is MB. Only files are allowed.
     
    The maximum number of 3 allowed files to upload has been reached. If you want to upload more files you have to delete one of the existing uploaded files first.
    The maximum number of 3 allowed files to upload has been reached. If you want to upload more files you have to delete one of the existing uploaded files first.
    Posting as

    Comments powered by CComment