Can Ethernet ENC28J60 works with SNMP using SPI protocol.  - Page 1
Forum section: electronics / general

author: radhika
author_rank: Regular Contributor
timestamp: April 05, 2020, 03:24:27 pm
content: Can Ethernet ENC28J60 works with SNMP using SPI protocol.I want to send 10 byte of data from PIC controller to SNMP using ethernet with SPI protocol. But, I don't have enough space to connect arduino, so I cant go with Ethernet Sheild W5100.I want to know:1. If ENC28J60 works with SNMP, can you share library?2. If ENC28J60 won't work, what ethernet should i use, which is programmable and work with SNMP as well.Awaiting responseThanks

author: fchk
author_rank: Frequent Contributor
timestamp: April 05, 2020, 04:44:02 pm
content: ENC28J60 is a standard Ethernet NIC and only handles Ethernet packets.Standard Ethernet NICs don't care about the contents of the packets they send or receive. The packets may not even be IP packets.So: Wrong question. You don't understand what you are doing. Get a solid understanding of IP and the OSI model.If you want to use SNMP, you need- any Ethernet interface- a hardware driver for that interface and your platform- a TCP/IP stack that uses the hardware driver- an SNMP library that uses the TCP/IP stack- your application using the SNMP libraryAnd: you dont send raw bytes with SNMP. You set variables to a value.

author: radhika
author_rank: Regular Contributor
timestamp: April 05, 2020, 05:52:21 pm
content: Quote from: fchk on April 05, 2020, 04:44:02 pmCan you share snmp library link? or attach here if you have any?

author: fchk
author_rank: Frequent Contributor
timestamp: April 05, 2020, 06:02:30 pm
content: Quote from: radhika on April 05, 2020, 05:52:21 pmNot unless you give complete information about your system and the EXACT type of your PIC.PS:If your PIC has got enough RAM (>3k) then look here:https://www.microchip.com/mplab/microchip-libraries-for-applicationsGet the "Legacy MLA", not the current one. The Current MLA doesn't have any hardware drivers any more.Get Installer for your OS and Help File. Read&understand help file. There is also SNMPv1 client support.If possible use a PIC18F67J60/87J60/97J60. These have integrated Ethernet and perform MUCH better than SPI Ethernet adapters. SPI is a bottleneck. A PIC18F97J60 gets twice the performace than the combo PIC18F8722/ENC28J60, although both have the same CPU core with nearly the same clock and the ethernet peripheral of the 97j60 is very similar to the ENC28J60.If you have a new project, go with PIC32MZ and the Harmony framework.

author: radhika
author_rank: Regular Contributor
timestamp: April 05, 2020, 06:44:05 pm
content: Quote from: fchk on April 05, 2020, 06:02:30 pmThanks for the much information. I will check that PIC which you suggested above. But currently I have PIC18F4520 which I want to use it for this project. I want to send 10 byte temperature data continuously to the SNMP V3 using Ethernet with SPI protocol. I am unable to find library whic work with my code.Thanks

author: fchk
author_rank: Frequent Contributor
timestamp: April 05, 2020, 08:01:27 pm
content: Quote from: radhika on April 05, 2020, 06:44:05 pmPIC18F4520 most likely won't work since it has only 2k of RAM, which won't be enough for the stack.And SNMP v3 ist not supported. You only will get v1. There is absolutely no chance of getting full SNMP v3 onto any 8 or 16 bit platform.If you want to stay with PIC, get this:https://www.olimex.com/Products/PIC/Proto/PIC-P67J60/This will work with the legacy MLA.Otherwise:https://microchipdeveloper.com/boards:pic32mz-efand Harmony

author: TomS_
author_rank: Frequent Contributor
timestamp: April 29, 2020, 10:04:04 pm
content: Quote from: radhika on April 05, 2020, 06:44:05 pmYou won't find one. You're talking about too many things in one go, and that's not how these things work.The OSI model provides distinct operational separation between various software and hardware layers to ensure that it is not a monolithic mess requiring everyone to reimplement the entire thing themselves on a per application basis.fchk has given a good breakdown of the stack of protocols and services that are involved in accomplishing what you are asking for. Unless you just happen to get lucky and find someone who has already done what you're looking for (which I think is highly unlikely), simply put, you're not likely to achieve this the way you are thinking about it.Sorry to sound all negative, but there will be no copy/paste code that magically makes this work.You are likely better off using something like a Raspberry Pi or similar running Linux, because all of the drivers, TCP/IP stack, and SNMP application, and bits in-between are taken care of already, and you only need to work out how to send the data you are interested in. Otherwise you have a hell of a lot of work ahead of you before you even start to think about sending data via SNMP.

author: rstofer
author_rank: Super Contributor
timestamp: April 29, 2020, 11:52:11 pm
content: Quote from: TomS_ link=topic=236268.msg3041620#msg3041620Raspberry Pi is probably the easiest way to get the project built.mbed libraries implement SNMP V2 (AFAICT) and using the original LPC1768 board is dead simple because the only thing it lacks is the Magjack. I built a carrier board with the Magjack and plugged in the LPC1768 board.https://os.mbed.com/platforms/mbed-LPC1768/This SNMP/mbed library thing would need more research by the OP.As it turns out, my mbed project gets a stream of plotter steps by SPI, converts accumulated steps to HPGL sentences, forms these in to bpackets and sends them out over a TCP socket connected to my Laserjet.I know exactly nothing about SNMP.For 'proof of concept', I would certainly want to use something with a full network stack - the Raspberry Pi is one such platform.ETA: Is SNMP an absolute requirement? Berkeley Sockets are a lot easier to use.

author: jackthomson43
author_rank: Contributor
timestamp: May 01, 2020, 12:32:53 pm
content: ENC28J60 is too difficult to operate. The easiest option will be Arduino UNO with Arduino Ethernet Shield. don't need to do anything, simply plug and play. It's library got builtin examples, too helpful. BtwESP8266is an excellent alternative.

author: viperidae
author_rank: Frequent Contributor
timestamp: May 02, 2020, 08:03:09 pm
content: Your don't need a full TCP/IP stack, SNMP uses UDP packets.I assume you're sending an SNMP trap.If you go with SNMP v1 or v2c all you need to do is build the packet and send it. You don't need a full SNMP library.

author: profdc9
author_rank: Frequent Contributor
timestamp: May 05, 2020, 09:59:58 pm
content: I did quite a bit of work with uIP and the ENC28J60 a number of years ago, making a programmable BASIC-language microcontroller that could be accessed over the internet. The project is herehttp://jumentum.sourceforge.net/You might look at this for clues on how to use ENC28J60 and uIP to do what you want with a small microcontroller.