bmspeedie / agentuino

Automatically exported from code.google.com/p/agentuino
0 stars 0 forks source link

We can´t use it with Arduino 1.0 core #2

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Can´t compile using Arduino 1.0

Errors:
\arduino-1.0\libraries\Agentuino\Agentuino.cpp: In member function 
'SNMP_API_STAT_CODES AgentuinoClass::begin()':
\arduino-1.0\libraries\Agentuino\Agentuino.cpp:39: error: 'Udp' was not 
declared in this scope
\arduino-1.0\libraries\Agentuino\Agentuino.cpp: In member function 
'SNMP_API_STAT_CODES AgentuinoClass::begin(char*, char*, uint16_t)':
\arduino-1.0\libraries\Agentuino\Agentuino.cpp:63: error: 'Udp' was not 
declared in this scope
\arduino-1.0\libraries\Agentuino\Agentuino.cpp: In member function 'void 
AgentuinoClass::listen()':
\arduino-1.0\libraries\Agentuino\Agentuino.cpp:73: error: 'Udp' was not 
declared in this scope
\arduino-1.0\libraries\Agentuino\Agentuino.cpp: In member function 
'SNMP_API_STAT_CODES AgentuinoClass::requestPdu(SNMP_PDU*)':
\arduino-1.0\libraries\Agentuino\Agentuino.cpp:98: error: 'Udp' was not 
declared in this scope
\arduino-1.0\libraries\Agentuino\Agentuino.cpp: In member function 
'SNMP_API_STAT_CODES AgentuinoClass::responsePdu(SNMP_PDU*)':
\arduino-1.0\libraries\Agentuino\Agentuino.cpp:350: error: 'Udp' was not 
declared in this scope

Original issue reported on code.google.com by portill...@gmail.com on 19 Dec 2011 at 8:20

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Is this might be the case?
New v 1.0 implementation
Support for DHCP and DNS has been added to the Ethernet library, thanks
  to integration by Adrian McEwen. Most classes in the Ethernet library
  have been renamed to add a "Ethernet" prefix and avoid conflicts with
  other networking libraries. In particular, "Client" is now
  "EthernetClient", "Server" is "EthernetServer", and "UDP" is
  "EthernetUDP". A new IPAddress class makes it easier to manipulate
  those values.

Original comment by rpardam...@gmail.com on 20 Dec 2011 at 9:21

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
It is not anything like that.
I knew that and all other changes have been made.
I would like any of the authors of Agentuino could help us.

Original comment by palacios...@gmail.com on 20 Dec 2011 at 2:21

GoogleCodeExporter commented 8 years ago
I see the same thing, trying to use in v1.0. Had to change "Wprogram.h" to 
"Ardruino.h" and work some other minor changes, still getting tons of errors 
though.

Original comment by ian.stei...@gmail.com on 31 Dec 2011 at 4:27

GoogleCodeExporter commented 8 years ago
Compiling under 022 worked fine, 019 would not upload to my Mega2560, 23 had 
some major changes that prevented Agentuino from working.

Original comment by ian.stei...@gmail.com on 31 Dec 2011 at 5:07

GoogleCodeExporter commented 8 years ago
any way for us mortals to make it work with 1.0? I really need this, so if 
anyone had any success, please share.

Original comment by alfso...@gmail.com on 15 Jan 2012 at 9:43

GoogleCodeExporter commented 8 years ago
Alright, I've headed into the adventure of fixing it myself, and finally I got 
it to compile without errors. 
(I'll get back to what changes I made to make it)

Doesn't work though. 

The last piece of code I needed to change, which I suspect is the culprit, was 
these;

Udp.readPacket(_packet, _packetSize, _dstIp, &_dstPort);
Udp.sendPacket(_packet, _packetSize, _dstIp, _dstPort); // not sure if it was 
sendPacket or writePacket ...

Into : 
Udp.read(_packet, _packetSize);
Udp.write(_packet, _packetSize);    

this was in Agentuino.cpp 

I'm guessing we don't know where to send data anymore with my Udp.write() , 
since I'm omitting the dst port and IP.  Anyone got a hint? Am I supposed to 
use a different function to read and write Udp packets with 1.0 ?

Original comment by alfso...@gmail.com on 21 Jan 2012 at 11:27

GoogleCodeExporter commented 8 years ago
quick update; Just needed a Udp.parsePacket() before Udp.read and 
Udp.beginPacket(Udp.remoteIP(), Udp.remotePort()); before Udp.write .. I've 
successfully compiled and made a working (answering) SNMP agent on 1.0. :) 

While I remember it, and in case I get hit by a bus tomorrow, and for those 
interested;

Change all references to WProgram.h to Arduino.h (as mentioned above by Ian), 
and edit Agentuino.cpp  .. gah, I'm just attaching all libraries related. :p 

Will do some testing now to see if it's stable and working as intended.

Original comment by alfso...@gmail.com on 21 Jan 2012 at 11:53

Attachments:

GoogleCodeExporter commented 8 years ago
Hi Everyone,

Sorry for being out of the loop for such a long time (Work and Personal 
commitments).

Another developer contacted me with updates and would like to share them with 
the community.  He was added to the project and trust that he will upload his 
efforts.

I plan on getting into this again once moved and setup.  Again, great to see so 
much interest in this library.

Regards,

Eric Gionet

Original comment by gionet.c...@gmail.com on 22 Jan 2012 at 3:30

GoogleCodeExporter commented 8 years ago
Uploaded changes (except those to external libraries) at rev 45. As previously 
mentioned, this needs testing. Appreciate any feedback.

- Alf -

Original comment by alfso...@gmail.com on 22 Jan 2012 at 3:57

GoogleCodeExporter commented 8 years ago
Please add the additional instructions for 1.0 (even the beta version) to the 
SVN tree. The Flash library reference and the new code changes.

Original comment by guto.and...@gmail.com on 3 Mar 2012 at 4:30