Can't load from Codebender :-(



  • Hi,
    My first go in a long while at making sensors and playing with Arduino. I have build the Ethernet Gateway, and am trying to upload the sketch using my Chrome browser and the Codebender Plugin. I Clone and edit the sketch, and it asked me if I want to use the libraries, and I say yes. I ask it to verify the code, and I get this message:

    Looks like your project uses header files or libraries that do not exist in our system, in your personal libraries or in your sketch. More info

    In file included from libraries/16221_cb_personal_lib_MySensors/Relay.cpp:12:
    In file included from libraries/16221_cb_personal_lib_MySensors/Relay.h:15:
    libraries/16221_cb_personal_lib_MySensors/Sensor.h:23:10: fatal error: 'EEPROM.h' file not found
    #include <EEPROM.h>
    ^
    1 error generated.

    Can someone tell me what the problem is?


  • Hero Member

    Which browser do you use?

    See http://www.mysensors.org/build/arduino:

    Some browsers might need some extra care to get the plugin working.

    I also read:

    The code compiles on cloud server with all libraries installed and ready to use.

    So did you get the code from http://www.mysensors.org/build/ethernet_gateway ?



  • I'm using Chrome on my Mac, and it should be working.

    And yes, I used the code from the link you provided.

    I'd say someone has changed the libraries.


  • Admin

    @daulagari said:

    http://www.mysensors.org/build/ethernet_gateway

    I can clone and verify sketch without any problems on my mac with chrome (just tested).

    But if you want to use the Ethernet sketch with the W5100 you still have to use the download Arduino IDE and modify things in sourcecode according to instructions.



  • @hek said:

    @daulagari said:

    http://www.mysensors.org/build/ethernet_gateway

    I can clone and verify sketch without any problems on my mac with chrome (just tested).

    But if you want to use the Ethernet sketch with the W5100 you still have to use the download Arduino IDE and modify things in sourcecode according to instructions.

    Ok cool, thanks for checking this for me 🙂

    I am trying to use the W5100. I am having troubles trying to understand how to follow the instructions on how to edit. Can I edit and then still use the Codebender Plugin?


  • Admin

    @Dean

    Probably easier to use the IDE and pull the libraries to your computer.



  • 😞 I'm hopeless..... I had this working months ago with the same parts, but it won't work. Last time I used the Codebender plugin, because it just wouldn't work on the computer. Now that I have to edit stuff, i am trying to do it on the computer, but it won't work. This is what I get:
    This report would have more information with
    "Show verbose output during compilation"
    enabled in File > Preferences.
    Arduino: 1.0.6 (Mac OS X), Board: "Arduino Uno"
    EthernetGateway:75: error: 'MyGateway' does not name a type
    EthernetGateway:81: error: 'MAX_RECEIVE_LENGTH' was not declared in this scope
    EthernetGateway.ino: In function 'void setup()':
    EthernetGateway:87: error: 'gw' was not declared in this scope
    EthernetGateway:87: error: 'RF24_PA_LEVEL_GW' was not declared in this scope
    EthernetGateway:87: error: 'RF24_CHANNEL' was not declared in this scope
    EthernetGateway:87: error: 'RF24_DATARATE' was not declared in this scope
    EthernetGateway.ino: In function 'void loop()':
    EthernetGateway:116: error: 'MAX_RECEIVE_LENGTH' was not declared in this scope
    EthernetGateway:121: error: 'inputString' was not declared in this scope
    EthernetGateway:126: error: 'gw' was not declared in this scope
    EthernetGateway:132: error: 'inputString' was not declared in this scope
    EthernetGateway:141: error: 'gw' was not declared in this scope



  • I just did what the output suggested. Here is what I get:

    Arduino: 1.0.6 (Mac OS X), Board: "Arduino Uno"
    /Users//Desktop/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=106 -I/Users//Desktop/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino -I/Users//Desktop/Arduino.app/Contents/Resources/Java/hardware/arduino/variants/standard -I/Users//Desktop/Arduino.app/Contents/Resources/Java/libraries/SPI -I/Users/*****/Desktop/Arduino.app/Contents/Resources/Java/libraries/Ethernet /var/folders/b6/mgvw5s257pd5pyz73nwwt4_r0000gn/T/build8097901850594856372.tmp/EthernetGateway.cpp -o /var/folders/b6/mgvw5s257pd5pyz73nwwt4_r0000gn/T/build8097901850594856372.tmp/EthernetGateway.cpp.o
    EthernetGateway.ino:41:90: warning: DigitalIO.h: No such file or directory
    EthernetGateway.ino:43:22: warning: MySensor.h: No such file or directory
    EthernetGateway.ino:44:25: warning: MyGateway.h: No such file or directory
    EthernetGateway:75: error: 'MyGateway' does not name a type
    EthernetGateway:81: error: 'MAX_RECEIVE_LENGTH' was not declared in this scope
    EthernetGateway.ino: In function 'void setup()':
    EthernetGateway:87: error: 'gw' was not declared in this scope
    EthernetGateway:87: error: 'RF24_PA_LEVEL_GW' was not declared in this scope
    EthernetGateway:87: error: 'RF24_CHANNEL' was not declared in this scope
    EthernetGateway:87: error: 'RF24_DATARATE' was not declared in this scope
    EthernetGateway.ino: In function 'void loop()':
    EthernetGateway:116: error: 'MAX_RECEIVE_LENGTH' was not declared in this scope
    EthernetGateway:121: error: 'inputString' was not declared in this scope
    EthernetGateway:126: error: 'gw' was not declared in this scope
    EthernetGateway:132: error: 'inputString' was not declared in this scope
    EthernetGateway:141: error: 'gw' was not declared in this scope



  • I think I have fixed it!!!

    It tells me that it is done compiling, so I hope that means it worked!! 🙂



  • Nope, looks like I celebrated too early....Vera can't communicate with the gateway, and I can't ping it. After uploading the sketch again I dug a little more and a find this:

    n file included from /Users//Documents/Arduino/libraries/DigitalIO/DigitalIO.h:34,
    from EthernetGateway.ino:35:
    /Users/
    /Documents/Arduino/libraries/DigitalIO/SoftI2cMaster.h: In member function 'bool SoftI2cMaster::writeScl(bool)':
    /Users//Documents/Arduino/libraries/DigitalIO/SoftI2cMaster.h:146: warning: no return statement in function returning non-void
    /Users/
    /Documents/Arduino/libraries/DigitalIO/SoftI2cMaster.h: In member function 'bool SoftI2cMaster::writeSda(bool)':
    /Users/*/Documents/Arduino/libraries/DigitalIO/SoftI2cMaster.h:159: warning: no return statement in function returning non-void

    At this stage I have no idea what I need to do to fix this, but I'll look and see what I find. Fingers crossed...



  • Nope, can't work out what is wrong..... 😞 I have no idea why I am getting this error.



  • OK, I am starting to feel really dumb... Many months ago I had the Ethernet Gateway working great, but I left it to pursue other stuff until now. I figure I would update stuff, but I should have left it all alone...

    Anyways, I am tired of trying to do this on my computer and not getting anywhere, so I am trying again using Codebender. For everyones info, this is what Codebender tells me:

    Looks like your project uses header files or libraries that do not exist in our system, in your personal libraries or in your sketch. More info

    In file included from libraries/16221_cb_personal_lib_MySensors/Relay.cpp:12:
    In file included from libraries/16221_cb_personal_lib_MySensors/Relay.h:15:
    In file included from libraries/16221_cb_personal_lib_MySensors/Sensor.h:18:
    libraries/16221_cb_personal_lib_MySensors/utility/RF24.h:47:3: error: unknown type name 'uint8_t'
    uint8_t ce_pin; /< "Chip Enable" pin, activates the RX or TX role */
    ^
    libraries/16221_cb_personal_lib_MySensors/utility/RF24.h:48:3: error: unknown type name 'uint8_t'
    uint8_t csn_pin; /
    < SPI Chip select /
    ^
    libraries/16221_cb_personal_lib_MySensors/utility/RF24.h:51:3: error: unknown type name 'uint8_t'
    uint8_t payload_size; /< Fixed size of payloads */
    ^
    libraries/16221_cb_personal_lib_MySensors/utility/RF24.h:53:3: error: unknown type name 'uint64_t'
    uint64_t pipe0_reading_address; /
    < Last address set on pipe 0 for reading. /
    ^
    libraries/16221_cb_personal_lib_MySensors/utility/RF24.h:73:8: error: unknown type name 'uint8_t'
    RF24(uint8_t _cepin, uint8_t _cspin);
    ^
    libraries/16221_cb_personal_lib_MySensors/utility/RF24.h:73:24: error: unknown type name 'uint8_t'
    RF24(uint8_t _cepin, uint8_t _cspin);
    ^
    libraries/16221_cb_personal_lib_MySensors/utility/RF24.h:139:25: error: unknown type name 'uint8_t'
    void read( void
    buf, uint8_t len );
    ^
    libraries/16221_cb_personal_lib_MySensors/utility/RF24.h:162:32: error: unknown type name 'uint8_t'
    bool write( const void
    buf, uint8_t len );
    ^
    libraries/16221_cb_personal_lib_MySensors/utility/RF24.h:182:24: error: unknown type name 'uint64_t'
    void openWritingPipe(uint64_t address);
    ^
    libraries/16221_cb_personal_lib_MySensors/utility/RF24.h:208:24: error: unknown type name 'uint8_t'
    void openReadingPipe(uint8_t number, uint64_t address);
    ^
    libraries/16221_cb_personal_lib_MySensors/utility/RF24.h:208:40: error: unknown type name 'uint64_t'
    void openReadingPipe(uint8_t number, uint64_t address);
    ^
    libraries/16221_cb_personal_lib_MySensors/utility/RF24.h:217:26: error: unknown type name 'uint8_t'
    void closeReadingPipe( uint8_t pipe ) ;
    ^
    libraries/16221_cb_personal_lib_MySensors/utility/RF24.h:245:18: error: unknown type name 'uint8_t'
    bool available(uint8_t* pipe_num);
    ^
    libraries/16221_cb_personal_lib_MySensors/utility/RF24.h:279:32: error: unknown type name 'uint8_t'
    bool write( const void* buf, uint8_t len, const bool multicast );
    ^
    libraries/16221_cb_personal_lib_MySensors/utility/RF24.h:312:36: error: unknown type name 'uint8_t'
    bool writeFast( const void* buf, uint8_t len );
    ^
    libraries/16221_cb_personal_lib_MySensors/utility/RF24.h:325:36: error: unknown type name 'uint8_t'
    bool writeFast( const void* buf, uint8_t len, const bool multicast );
    ^
    libraries/16221_cb_personal_lib_MySensors/utility/RF24.h:355:40: error: unknown type name 'uint8_t'
    bool writeBlocking( const void* buf, uint8_t len, uint32_t timeout );
    ^
    libraries/16221_cb_personal_lib_MySensors/utility/RF24.h:355:53: error: unknown type name 'uint32_t'
    bool writeBlocking( const void* buf, uint8_t len, uint32_t timeout );
    ^
    libraries/16221_cb_personal_lib_MySensors/utility/RF24.h:403:19: error: unknown type name 'uint32_t'
    bool txStandBy(uint32_t timeout);
    ^
    libraries/16221_cb_personal_lib_MySensors/utility/RF24.h:419:24: error: unknown type name 'uint8_t'
    void writeAckPayload(uint8_t pipe, const void* buf, uint8_t len);
    ^
    libraries/16221_cb_personal_lib_MySensors/utility/RF24.h:419:55: error: unknown type name 'uint8_t'
    void writeAckPayload(uint8_t pipe, const void* buf, uint8_t len);
    ^
    libraries/16221_cb_personal_lib_MySensors/utility/RF24.h:485:41: error: unknown type name 'uint8_t'
    void startFastWrite( const void* buf, uint8_t len, const bool multicast );
    ^
    libraries/16221_cb_personal_lib_MySensors/utility/RF24.h:511:37: error: unknown type name 'uint8_t'
    void startWrite( const void* buf, uint8_t len, const bool multicast );
    ^
    libraries/16221_cb_personal_lib_MySensors/utility/RF24.h:537:3: error: unknown type name 'uint8_t'
    uint8_t flush_tx(void);
    ^
    libraries/16221_cb_personal_lib_MySensors/utility/RF24.h:607:19: error: unknown type name 'uint8_t'
    void setRetries(uint8_t delay, uint8_t count);
    ^
    libraries/16221_cb_personal_lib_MySensors/utility/RF24.h:607:34: error: unknown type name 'uint8_t'
    void setRetries(uint8_t delay, uint8_t count);
    ^
    libraries/16221_cb_personal_lib_MySensors/utility/RF24.h:614:19: error: unknown type name 'uint8_t'
    void setChannel(uint8_t channel);
    ^
    libraries/16221_cb_personal_lib_MySensors/utility/RF24.h:628:23: error: unknown type name 'uint8_t'
    void setPayloadSize(uint8_t size);
    ^
    libraries/16221_cb_personal_lib_MySensors/utility/RF24.h:637:3: error: unknown type name 'uint8_t'
    uint8_t getPayloadSize(void);
    ^
    libraries/16221_cb_personal_lib_MySensors/utility/RF24.h:650:3: error: unknown type name 'uint8_t'
    uint8_t getDynamicPayloadSize(void);
    ^
    libraries/16221_cb_personal_lib_MySensors/utility/RF24.h:699:20: error: unknown type name 'uint8_t'
    void setAutoAck( uint8_t pipe, bool enable ) ;
    ^
    libraries/16221_cb_personal_lib_MySensors/utility/RF24.h:712:21: error: unknown type name 'uint8_t'
    void setPALevel ( uint8_t level );
    ^
    libraries/16221_cb_personal_lib_MySensors/utility/RF24.h:722:4: error: unknown type name 'uint8_t'
    uint8_t getPALevel( void );
    ^
    libraries/16221_cb_personal_lib_MySensors/utility/RF24.h:802:3: error: unknown type name 'uint8_t'
    uint8_t read_register(uint8_t reg, uint8_t* buf, uint8_t len);
    ^
    libraries/16221_cb_personal_lib_MySensors/utility/RF24.h:802:25: error: unknown type name 'uint8_t'
    uint8_t read_register(uint8_t reg, uint8_t* buf, uint8_t len);
    ^
    libraries/16221_cb_personal_lib_MySensors/utility/RF24.h:802:38: error: unknown type name 'uint8_t'
    uint8_t read_register(uint8_t reg, uint8_t* buf, uint8_t len);
    ^
    libraries/16221_cb_personal_lib_MySensors/utility/RF24.h:802:52: error: unknown type name 'uint8_t'
    uint8_t read_register(uint8_t reg, uint8_t* buf, uint8_t len);
    ^
    libraries/16221_cb_personal_lib_MySensors/utility/RF24.h:810:3: error: unknown type name 'uint8_t'
    uint8_t read_register(uint8_t reg);
    ^
    libraries/16221_cb_personal_lib_MySensors/utility/RF24.h:810:25: error: unknown type name 'uint8_t'
    uint8_t read_register(uint8_t reg);
    ^
    libraries/16221_cb_personal_lib_MySensors/utility/RF24.h:820:3: error: unknown type name 'uint8_t'
    uint8_t write_register(uint8_t reg, const uint8_t* buf, uint8_t len);
    ^
    libraries/16221_cb_personal_lib_MySensors/utility/RF24.h:820:26: error: unknown type name 'uint8_t'
    uint8_t write_register(uint8_t reg, const uint8_t* buf, uint8_t len);
    ^
    libraries/16221_cb_personal_lib_MySensors/utility/RF24.h:820:45: error: unknown type name 'uint8_t'
    uint8_t write_register(uint8_t reg, const uint8_t* buf, uint8_t len);
    ^
    libraries/16221_cb_personal_lib_MySensors/utility/RF24.h:820:59: error: unknown type name 'uint8_t'
    uint8_t write_register(uint8_t reg, const uint8_t* buf, uint8_t len);
    ^
    libraries/16221_cb_personal_lib_MySensors/utility/RF24.h:829:3: error: unknown type name 'uint8_t'
    uint8_t write_register(uint8_t reg, uint8_t value);
    ^
    libraries/16221_cb_personal_lib_MySensors/utility/RF24.h:829:26: error: unknown type name 'uint8_t'
    uint8_t write_register(uint8_t reg, uint8_t value);
    ^
    libraries/16221_cb_personal_lib_MySensors/utility/RF24.h:829:39: error: unknown type name 'uint8_t'
    uint8_t write_register(uint8_t reg, uint8_t value);
    ^
    libraries/16221_cb_personal_lib_MySensors/utility/RF24.h:840:3: error: unknown type name 'uint8_t'
    uint8_t write_payload(const void* buf, uint8_t len, const uint8_t writeType);
    ^
    libraries/16221_cb_personal_lib_MySensors/utility/RF24.h:840:42: error: unknown type name 'uint8_t'
    uint8_t write_payload(const void* buf, uint8_t len, const uint8_t writeType);
    ^
    libraries/16221_cb_personal_lib_MySensors/utility/RF24.h:840:61: error: unknown type name 'uint8_t'
    uint8_t write_payload(const void* buf, uint8_t len, const uint8_t writeType);
    ^
    libraries/16221_cb_personal_lib_MySensors/utility/RF24.h:851:3: error: unknown type name 'uint8_t'
    uint8_t read_payload(void* buf, uint8_t len);
    ^
    libraries/16221_cb_personal_lib_MySensors/utility/RF24.h:851:35: error: unknown type name 'uint8_t'
    uint8_t read_payload(void* buf, uint8_t len);
    ^
    libraries/16221_cb_personal_lib_MySensors/utility/RF24.h:858:3: error: unknown type name 'uint8_t'
    uint8_t flush_rx(void);
    ^
    libraries/16221_cb_personal_lib_MySensors/utility/RF24.h:865:3: error: unknown type name 'uint8_t'
    uint8_t get_status(void);
    ^
    libraries/16221_cb_personal_lib_MySensors/utility/RF24.h:874:21: error: unknown type name 'uint8_t'
    void print_status(uint8_t status);
    ^
    libraries/16221_cb_personal_lib_MySensors/utility/RF24.h:883:25: error: unknown type name 'uint8_t'
    void print_observe_tx(uint8_t value);
    ^
    libraries/16221_cb_personal_lib_MySensors/utility/RF24.h:896:46: error: unknown type name 'uint8_t'
    void print_byte_register(const char* name, uint8_t reg, uint8_t qty = 1);
    ^
    libraries/16221_cb_personal_lib_MySensors/utility/RF24.h:896:59: error: unknown type name 'uint8_t'
    void print_byte_register(const char* name, uint8_t reg, uint8_t qty = 1);
    ^
    libraries/16221_cb_personal_lib_MySensors/utility/RF24.h:909:49: error: unknown type name 'uint8_t'
    void print_address_register(const char* name, uint8_t reg, uint8_t qty = 1);
    ^
    libraries/16221_cb_personal_lib_MySensors/utility/RF24.h:909:62: error: unknown type name 'uint8_t'
    void print_address_register(const char* name, uint8_t reg, uint8_t qty = 1);
    ^
    libraries/16221_cb_personal_lib_MySensors/utility/RF24.h:923:3: error: unknown type name 'uint8_t'
    uint8_t spiTrans(uint8_t cmd);
    ^
    libraries/16221_cb_personal_lib_MySensors/utility/RF24.h:923:20: error: unknown type name 'uint8_t'
    uint8_t spiTrans(uint8_t cmd);
    ^
    In file included from libraries/16221_cb_personal_lib_MySensors/Relay.cpp:12:
    In file included from libraries/16221_cb_personal_lib_MySensors/Relay.h:15:
    libraries/16221_cb_personal_lib_MySensors/Sensor.h:23:10: fatal error: 'EEPROM.h' file not found
    #include <EEPROM.h>
    ^
    62 errors generated.

    Looks to me like the issue is maybe the linked libraries aren't accessable to everyone, which is why it repports that they are missing??



  • This is funny..... when I posted the screenshot of the error in my first post, there was only one error; now it looks like there are 62, and I didn't change a thing... Anyone know what's going on?



  • OK, I think there is a fault, because I even tried to verify an old sketch that did once work, and I get the same number of errors and it tells me there are missing libraries. 😞 😞



  • OK I really am going mad..... still trying to get this to work, and now I am getting the same error as I did in the first post. What's going on????



  • I'm still trying.... Now I am using Firefox and the errors have gone back up to a total of 62 errors. I just tried it again with Chrome, and it too is reporting the same number of errors.



  • Time to give up for a while. Already lost a day trying to get this to work....



  • It's annoying me that I can't get this to work lol

    As a test, I tried verifying the code using Codebender for the serial gateway, and I get the same result. 62 errors.

    When I hover the mouse over this : #include <stdarg.h> it says "file not detected"

    😞



  • I don't think there is any point continuing to try and sort this out using Codebender. My guess is that the libraries attached to the sketches don't match anymore or something like that, because I have tried both types of gateways, as well as a couple sensors, and I'm getting errors all the time.



  • OK, I am trying again on my computer, and I get a lot further than using Codebender. Again, the message I am getting is this:

    In file included from /Users//Documents/Arduino/libraries/DigitalIO/DigitalIO.h:34,
    from EthernetGateway.ino:34:
    /Users/
    /Documents/Arduino/libraries/DigitalIO/SoftI2cMaster.h: In member function 'bool SoftI2cMaster::writeScl(bool)':
    /Users//Documents/Arduino/libraries/DigitalIO/SoftI2cMaster.h:143: warning: no return statement in function returning non-void
    /Users/
    /Documents/Arduino/libraries/DigitalIO/SoftI2cMaster.h: In member function 'bool SoftI2cMaster::writeSda(bool)':
    /Users/***/Documents/Arduino/libraries/DigitalIO/SoftI2cMaster.h:156: warning: no return statement in function returning non-void

    Can anyone point me in the right direction as to how to fix this?


  • Admin

    This only looks like warnings .. Which IDE version?



  • @hek said:

    This only looks like warnings .. Which IDE version?

    1.0.6.


  • Contest Winner

    @Dean said:

    /Users/*/Documents/Arduino/libraries/DigitalIO/SoftI2cMaster.h:156: warning: no return statement in function returning non-void

    ...and they look to be warnings from the library, not your sketch, which would appear with a line number.

    what does your sketch look like now?



    • Copyright (C) 2013 Henrik Ekblad henrik.ekblad@gmail.com
    • Contribution by a-lurker
    • This program is free software; you can redistribute it and/or
    • modify it under the terms of the GNU General Public License
    • version 2 as published by the Free Software Foundation.
    • DESCRIPTION
    • The EthernetGateway sends data received from sensors to the ethernet link.
    • The gateway also accepts input on ethernet interface, which is then sent out to the radio network.
    • The GW code is designed for Arduino 328p / 16MHz. ATmega168 does not have enough memory to run this program.
    • COMPILING WIZNET (W5100) ETHERNET MODULE
    • Edit RF24_config.h in (libraries\MySensors\utility) to enable softspi (remove // before "#define SOFTSPI").

    • VERA CONFIGURATION:
    • Enter "ip-number:port" in the ip-field of the Arduino GW device. This will temporarily override any serial configuration for the Vera plugin.
    • E.g. If you want to use the defualt values in this sketch enter: 192.168.178.66:5003
    • LED purposes:
      • RX (green) - blink fast on radio message recieved. In inclusion mode will blink fast only on presentation recieved
      • TX (yellow) - blink fast on radio message transmitted. In inclusion mode will blink slowly
      • ERR (red) - fast blink on error during transmission error or recieve crc error
    • See http://www.mysensors.org/build/ethernet_gateway for wiring instructions.

    */

    #include <DigitalIO.h> // This include can be removed when using UIPEthernet module
    #include <SPI.h>
    #include <MySensor.h>
    #include <MyGateway.h>
    #include <stdarg.h>

    // Use this if you have attached a Ethernet ENC28J60 shields
    //#include <UIPEthernet.h>

    // Use this fo WizNET W5100 module and Arduino Ethernet Shield
    #include <Ethernet.h>

    #define INCLUSION_MODE_TIME 1 // Number of minutes inclusion mode is enabled
    #define INCLUSION_MODE_PIN 3 // Digital pin used for inclusion mode button

    #define RADIO_CE_PIN 5 // radio chip enable
    #define RADIO_SPI_SS_PIN 6 // radio SPI serial select
    #define RADIO_ERROR_LED_PIN 7 // Error led pin
    #define RADIO_RX_LED_PIN 8 // Receive led pin
    #define RADIO_TX_LED_PIN 9 // the PCB, on board LED

    #define IP_PORT 5003 // The port you want to open
    IPAddress myIp (192, 168, 178, 66); // Configure your static ip-address here COMPILE ERROR HERE? Use Arduino IDE 1.5.7 or later!

    // The MAC address can be anything you want but should be unique on your network.
    // Newer boards have a MAC address printed on the underside of the PCB, which you can (optionally) use.
    // Note that most of the Ardunio examples use "DEAD BEEF FEED" for the MAC address.
    byte mac[] = { 0xDE, 0xED, 0xBE, 0xEF, 0xFE, 0xED }; // DEED BEEF FEED

    // a R/W server on the port
    EthernetServer server = EthernetServer(IP_PORT);

    // No blink or button functionality. Use the vanilla constructor.
    MyGateway gw(RADIO_CE_PIN, RADIO_SPI_SS_PIN, INCLUSION_MODE_TIME);

    // Uncomment this constructor if you have leds and include button attached to your gateway
    //MyGateway gw(RADIO_CE_PIN, RADIO_SPI_SS_PIN, INCLUSION_MODE_TIME, INCLUSION_MODE_PIN, RADIO_RX_LED_PIN, RADIO_TX_LED_PIN, RADIO_ERROR_LED_PIN);

    char inputString[MAX_RECEIVE_LENGTH] = ""; // A string to hold incoming commands from serial/ethernet interface
    int inputPos = 0;

    void setup()
    {
    // Initialize gateway at maximum PA level, channel 70 and callback for write operations
    gw.begin(RF24_PA_LEVEL_GW, RF24_CHANNEL, RF24_DATARATE, writeEthernet);

    Ethernet.begin(mac, myIp);

    // give the Ethernet interface a second to initialize
    delay(1000);

    // start listening for clients
    server.begin();
    }

    // This will be called when data should be written to ethernet
    void writeEthernet(char *writeBuffer) {
    server.write(writeBuffer);
    }

    void loop()
    {
    // if an incoming client connects, there will be
    // bytes available to read via the client object
    EthernetClient client = server.available();

    if (client) {
    // if got 1 or more bytes
    if (client.available()) {
    // read the bytes incoming from the client
    char inChar = client.read();

         if (inputPos<MAX_RECEIVE_LENGTH-1) { 
           // if newline then command is complete
           if (inChar == '\n') {  
              // a command was issued by the client
              // we will now try to send it to the actuator
              inputString[inputPos] = 0;
    
              // echo the string to the serial port
              Serial.print(inputString);
    
              gw.parseAndSend(inputString);
    
              // clear the string:
              inputPos = 0;
           } else {  
             // add it to the inputString:
             inputString[inputPos] = inChar;
             inputPos++;
           }
        } else {
           // Incoming message too long. Throw away 
           inputPos = 0;
        }
      }
    

    }
    gw.processRadioMessage();
    }



  • Sorry it looks like a mess. It is the same as the example on this site.

    I will see if I can work out how to post it in a more readable way.



  • This post is deleted!


  • Look like the problem all along was the sketch that I copied from Codebender. In the end it appears that I wasn't the only problem with the issue, and this is where I found the fix : http://forum.mysensors.org/topic/737/uno-w5100-shield-not-pinging


Log in to reply
 

Suggested Topics

  • 3
  • 6
  • 6
  • 5
  • 2
  • 1

7
Online

11.4k
Users

11.1k
Topics

112.7k
Posts