What is SNMP?
When I got my NXT2WIFI sensor from Daniele I was quite sure what I wanted to make with it: an SNMP agent. What is an SNMP agent, you say? SNMP, short for Simple Network Management Protocol, is a protocol that, as you may have guessed by now, a protocol that can be used for monitoring and configuring networked devices. It is often used in enterprises to keep track of load metrics on routers, switches, etc. It can also be used as a means to send alerts by devices to a central point when something’s wrong or if a special event has happened. There are many versions of SNMP, v1 being the simplest of them all. There are two parties with SNMP, the agent, which is the networked device we’re interested in monitoring, and the manager, which is the device that listens for incoming alerts and polls the agents. You can read a LOT more about SNMP here: [LINK].
What have I made?
What I have done is implement a very simple SNMP agent in ROBOTC that returns the string “Mindstorms” when the iso.3.6.1.2.1.1.5.0 Object ID (OID) is queried. To be fair, my current code doesn’t check the OID yet, it’s hardcoded. However, the way the SNMP reply is created, is not, this will come in handy when I extend this agent. It should be fairly trivial to add additional queries that the agent responds to.
What does it look like?
Using the snmpget utility under Linux, I can execute the following:
“public” is the name of the SNMP community, 192.168.1.178 is the IP address of the NXT and iso.3.6.1.2.1.1.5.0 is the OID we’re interested in. The second line is the response from the NXT over Wi-Fi: “Mindstorms”. I’ve made some screenshots of Wireshark running and capturing the data:
This was all part of writing an example to use with the driver I am currently writing for the NXT2WIFI. The source code will be part of the driver suite when I add support for this sensor.
Stay tuned as I expand this example with more interesting metrics to read from the NXT!
Oh man. That is cool! We can use a NMS to have actual info from all NXT devices in the network without any additional s/w pooling them.
From another side, did you consider to send traps from NXT instead of pooling them?
Oh sure, but Rome wasn’t built in a day 🙂
Hi Xander,
I just recently got the tetrix set that is compatible with the Mindstorm set and was wondering if you know of any good tutorials that teach me how to program the tetrix and mindstorm?
Thanks!
Michael, I don’t really know of any but you can download a few samples here: http://www.robotc.net/education/curriculum/tetrix/ . As far as I know, you don’t really need to know all that much, it’s still powered by an NXT, only the stuff you make the robot with and the controllers are different.
– Xander
Hey Xander,
do you think it’s possible to use one NXT2WIFI with 2 nxt by splitting the Rs485 port?
It would be more than convinient for robots with more then one nxt!
greets!
No, I don’t think it would be possible in any practical sense. Just connect the two NXTs with Bluetooth 🙂
I don’t like using bluetooth for Pc to Nxt or Nxt to Nxt communication…
i thought i could send an order to the nxt2wifi from the pc and than retrieve it on 2 Nxt via the rs 485 bus…
No, that is not possible.
okay, than i need to buy 2 more nxt2wifi ^^