hirotakaster / CoAP-simple-library

Other
111 stars 48 forks source link

esp32.ino test #7

Open dserbu opened 5 years ago

dserbu commented 5 years ago

I am trying to test esp32.ino file but i'm not able .

Arduino: 1.8.8 (Linux), Board: ""WeMos" WiFi&Bluetooth Battery, 80MHz, 921600, None"

In file included from /home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/coap/coap.h:26:0,
                 from /home/user/Arduino/libraries/CoAP-simple-library/examples/esp32/esp32.ino:3:
/home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/coap/address.h:102:19: error: variable or field 'coap_address_init' declared void
 coap_address_init(coap_address_t *addr) {
                   ^
/home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/coap/address.h:102:19: error: 'coap_address_t' was not declared in this scope
/home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/coap/address.h:102:35: error: 'addr' was not declared in this scope
 coap_address_init(coap_address_t *addr) {
                                   ^
/home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/coap/address.h:118:27: error: 'coap_address_t' does not name a type
 coap_address_equals(const coap_address_t *a, const coap_address_t *b) {
                           ^
/home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/coap/address.h:118:52: error: 'coap_address_t' does not name a type
 coap_address_equals(const coap_address_t *a, const coap_address_t *b) {
                                                    ^
/home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/coap/address.h: In function 'int coap_address_equals(const int*, const int*)':
/home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/coap/address.h:120:40: error: '_coap_address_equals_impl' was not declared in this scope
   return _coap_address_equals_impl(a, b);
                                        ^
/home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/coap/address.h: At global scope:
/home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/coap/address.h:130:26: error: 'coap_address_t' does not name a type
 coap_address_isany(const coap_address_t *a) {
                          ^
/home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/coap/address.h: In function 'int coap_address_isany(const int*)':
/home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/coap/address.h:132:36: error: '_coap_address_isany_impl' was not declared in this scope
   return _coap_address_isany_impl(a);
                                    ^
/home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/coap/address.h: At global scope:
/home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/coap/address.h:147:21: error: 'coap_address_t' does not name a type
 coap_is_mcast(const coap_address_t *a) {
                     ^
/home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/coap/address.h: In function 'int coap_is_mcast(const int*)':
/home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/coap/address.h:148:36: error: '_coap_is_mcast_impl' was not declared in this scope
   return a && _coap_is_mcast_impl(a);
                                    ^
In file included from /home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/coap/net.h:23:0,
                 from /home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/coap/async.h:18,
                 from /home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/coap/coap.h:27,
                 from /home/user/Arduino/libraries/CoAP-simple-library/examples/esp32/esp32.ino:3:
/home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/coap/coap_io.h: At global scope:
/home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/coap/coap_io.h:50:3: error: 'coap_address_t' does not name a type
   coap_address_t addr; /**< local interface address */
   ^
/home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/coap/coap_io.h:58:42: error: 'coap_address_t' does not name a type
 coap_endpoint_t *coap_new_endpoint(const coap_address_t *addr, int flags);
                                          ^
/home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/coap/coap_io.h:77:33: error: 'coap_address_t' does not name a type
                           const coap_address_t *dst,
                                 ^
/home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/coap/coap_io.h:116:53: error: 'coap_address_t' has not been declared
 void coap_packet_copy_source(coap_packet_t *packet, coap_address_t *target);
                                                     ^
In file included from /home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/coap/net.h:24:0,
                 from /home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/coap/async.h:18,
                 from /home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/coap/coap.h:27,
                 from /home/user/Arduino/libraries/CoAP-simple-library/examples/esp32/esp32.ino:3:
/home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/coap/coap_time.h:128:32: error: 'coap_time_lt' declared as an 'inline' variable
 static inline int coap_time_lt(coap_tick_t a, coap_tick_t b) {
                                ^
/home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/coap/coap_time.h:128:32: error: 'coap_tick_t' was not declared in this scope
/home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/coap/coap_time.h:128:47: error: 'coap_tick_t' was not declared in this scope
 static inline int coap_time_lt(coap_tick_t a, coap_tick_t b) {
                                               ^
/home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/coap/coap_time.h:128:60: error: expression list treated as compound expression in initializer [-fpermissive]
 static inline int coap_time_lt(coap_tick_t a, coap_tick_t b) {
                                                            ^
/home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/coap/coap_time.h:128:62: error: expected ',' or ';' before '{' token
 static inline int coap_time_lt(coap_tick_t a, coap_tick_t b) {
                                                              ^
/home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/coap/coap_time.h:136:32: error: 'coap_time_le' declared as an 'inline' variable
 static inline int coap_time_le(coap_tick_t a, coap_tick_t b) {
                                ^
/home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/coap/coap_time.h:136:32: error: 'coap_tick_t' was not declared in this scope
/home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/coap/coap_time.h:136:47: error: 'coap_tick_t' was not declared in this scope
 static inline int coap_time_le(coap_tick_t a, coap_tick_t b) {
                                               ^
/home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/coap/coap_time.h:136:60: error: expression list treated as compound expression in initializer [-fpermissive]
 static inline int coap_time_le(coap_tick_t a, coap_tick_t b) {
                                                            ^
/home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/coap/coap_time.h:136:62: error: expected ',' or ';' before '{' token
 static inline int coap_time_le(coap_tick_t a, coap_tick_t b) {
                                                              ^
In file included from /home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/coap/async.h:18:0,
                 from /home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/coap/coap.h:27,
                 from /home/user/Arduino/libraries/CoAP-simple-library/examples/esp32/esp32.ino:3:
/home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/coap/net.h:33:3: error: 'coap_tick_t' does not name a type
   coap_tick_t t;                /**< when to send PDU for the next time */
   ^
/home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/coap/net.h:38:3: error: 'coap_address_t' does not name a type
   coap_address_t remote;        /**< remote address */
   ^
/home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/coap/net.h:64:47: error: 'coap_address_t' does not name a type
                                         const coap_address_t *remote,
                                               ^
/home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/coap/net.h:89:3: error: 'coap_tick_t' does not name a type
   coap_tick_t sendqueue_basetime;
   ^
/home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/coap/net.h:126:33: error: 'coap_address_t' does not name a type
                           const coap_address_t *dst,
                                 ^
/home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/coap/net.h:162:56: error: 'coap_tick_t' has not been declared
 unsigned int coap_adjust_basetime(coap_context_t *ctx, coap_tick_t now);
                                                        ^
/home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/coap/net.h:177:40: error: 'coap_address_t' does not name a type
 coap_context_t *coap_new_context(const coap_address_t *listen_addr);
                                        ^
/home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/coap/net.h:223:38: error: 'coap_address_t' does not name a type
                                const coap_address_t *dst,
                                      ^
/home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/coap/net.h:263:28: error: 'coap_address_t' does not name a type
                      const coap_address_t *dst,
                            ^
/home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/coap/net.h:287:34: error: 'coap_address_t' does not name a type
                            const coap_address_t *dst,
                                  ^
/home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/coap/net.h:308:30: error: 'coap_address_t' does not name a type
                        const coap_address_t *dst,
                              ^
/home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/coap/net.h:328:32: error: 'coap_address_t' does not name a type
                          const coap_address_t *dst,
                                ^
/home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/coap/net.h:348:21: error: 'coap_address_t' does not name a type
               const coap_address_t *dst,
                     ^
/home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/coap/net.h:390:32: error: 'coap_address_t' does not name a type
 void coap_transaction_id(const coap_address_t *peer,
                                ^
/home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/coap/net.h:453:37: error: 'coap_address_t' does not name a type
                               const coap_address_t *dst,
                                     ^
/home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/coap/net.h:471:17: error: variable or field 'coap_ticks' declared void
 void coap_ticks(coap_tick_t *);
                 ^
/home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/coap/net.h:471:17: error: 'coap_tick_t' was not declared in this scope
/home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/coap/net.h:471:30: error: expected primary-expression before ')' token
 void coap_ticks(coap_tick_t *);
                              ^
In file included from /home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/coap/coap.h:27:0,
                 from /home/user/Arduino/libraries/CoAP-simple-library/examples/esp32/esp32.ino:3:
/home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/coap/async.h:39:3: error: 'coap_tick_t' does not name a type
   coap_tick_t created;
   ^
/home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/coap/async.h:49:3: error: 'coap_address_t' does not name a type
   coap_address_t peer;             /**< the peer to notify */
   ^
/home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/coap/async.h:86:21: error: 'coap_address_t' has not been declared
                     coap_address_t *peer,
                     ^
/home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/coap/async.h: In function 'void coap_touch_async(coap_async_state_t*)':
/home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/coap/async.h:140:58: error: 'coap_async_state_t {aka struct coap_async_state_t}' has no member named 'created'
 coap_touch_async(coap_async_state_t *s) { coap_ticks(&s->created); }
                                                          ^
/home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/coap/async.h:140:65: error: 'coap_ticks' was not declared in this scope
 coap_touch_async(coap_async_state_t *s) { coap_ticks(&s->created); }
                                                                 ^
In file included from /home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/coap/resource.h:36:0,
                 from /home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/coap/coap.h:39,
                 from /home/user/Arduino/libraries/CoAP-simple-library/examples/esp32/esp32.ino:3:
/home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/coap/subscribe.h: At global scope:
/home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/coap/subscribe.h:57:18: error: field 'subscriber' has incomplete type 'coap_address_t'
   coap_address_t subscriber;        /**< address and port of subscriber */
                  ^
In file included from /home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/coap/coap.h:32:0,
                 from /home/user/Arduino/libraries/CoAP-simple-library/examples/esp32/esp32.ino:3:
/home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/coap/debug.h:71:8: note: forward declaration of 'struct coap_address_t'
 struct coap_address_t;
        ^
esp32:9:24: error: variable or field 'callback_response' declared void
 void callback_response(CoapPacket &packet, IPAddress ip, int port);
                        ^
esp32:9:24: error: 'CoapPacket' was not declared in this scope
esp32:9:36: error: 'packet' was not declared in this scope
 void callback_response(CoapPacket &packet, IPAddress ip, int port);
                                    ^
esp32:9:54: error: expected primary-expression before 'ip'
 void callback_response(CoapPacket &packet, IPAddress ip, int port);
                                                      ^
esp32:9:58: error: expected primary-expression before 'int'
 void callback_response(CoapPacket &packet, IPAddress ip, int port);
                                                          ^
esp32:12:21: error: variable or field 'callback_light' declared void
 void callback_light(CoapPacket &packet, IPAddress ip, int port);
                     ^
esp32:12:21: error: 'CoapPacket' was not declared in this scope
esp32:12:33: error: 'packet' was not declared in this scope
 void callback_light(CoapPacket &packet, IPAddress ip, int port);
                                 ^
esp32:12:51: error: expected primary-expression before 'ip'
 void callback_light(CoapPacket &packet, IPAddress ip, int port);
                                                   ^
esp32:12:55: error: expected primary-expression before 'int'
 void callback_light(CoapPacket &packet, IPAddress ip, int port);
                                                       ^
esp32:16:1: error: 'Coap' does not name a type
 Coap coap(udp);
 ^
esp32:22:21: error: variable or field 'callback_light' declared void
 void callback_light(CoapPacket &packet, IPAddress ip, int port) {
                     ^
esp32:22:21: error: 'CoapPacket' was not declared in this scope
esp32:22:33: error: 'packet' was not declared in this scope
 void callback_light(CoapPacket &packet, IPAddress ip, int port) {
                                 ^
esp32:22:51: error: expected primary-expression before 'ip'
 void callback_light(CoapPacket &packet, IPAddress ip, int port) {
                                                   ^
esp32:22:55: error: expected primary-expression before 'int'
 void callback_light(CoapPacket &packet, IPAddress ip, int port) {
                                                       ^
Multiple libraries were found for "WiFi.h"
 Used: /home/user/.arduino15/packages/esp32/hardware/esp32/1.0.1/libraries/WiFi
 Not used: /opt/arduino-1.8.8/libraries/WiFi
exit status 1
variable or field 'callback_response' declared void
hirotakaster commented 5 years ago

Hi @dserbu Now it resolved the conflicting ESP32 coap library and this library on new version.

dserbu commented 5 years ago

Thanks for the quick update, it works now. One more question, is there possible to add also an observer for a resource with this library?

hirotakaster commented 5 years ago

Now this library don't have an Observe, but it will be possible.

dserbu commented 5 years ago

Ok, the initial issue is solved.

dserbu commented 5 years ago

Now this library don't have an Observe, but it will be possible.

Can you give me some suggestions on that. I would like to try it.