XBeeInternetGateway / XIG

XBee Internet Gateway for the Digi ConnectPort and Digi XBee
11 stars 12 forks source link

Can't upload data to iDigi Device Cloud #47

Open firmwareguru opened 7 years ago

firmwareguru commented 7 years ago

Is anyone still using this software?

I'd really like to set this up and develop/test my network before going out and buying a gateway.

I'm running the "XIG - XBee Internet Gateway Leds and Buttons Example" in the Programmable XBee development kit to get a sense of how Device Cloud works. I've programmed the modules and setup and run XIG on my Windows 10 PC. Connection to Device Cloud seems OK, my "device" shows up under Device Management->Devices, and XIG reports connected to Device Cloud and the Xbee is "Joined or Formed Network". Ok, so far looks good.

However, when a message is received by XIG from an XBee device, the upload attempts to the cloud fail with:

xig.idigi_data - error during upload "idigidata error: (False, 400, 'Bad Request')"

That's as far as I get. I changed the server in settings_json to "idigi_server": "developer.idigi.com" and that changed nothing.

Essentially, the response is "400 API Deprecated".

What are my options now to get my devices onto the iDigi / Device Cloud? I see they're now calling it "Digi Remote Management".

With a Wireshark capture, I see the following HTTP PUT request and response:

Hypertext Transfer Protocol
    PUT /ws/device/xig_1499714370367.xml HTTP/1.0\r\n
        Request Method: PUT
        Request URI: /ws/device/xig_1499714370367.xml
        Request Version: HTTP/1.0
    Authorization: Basic 
....
    Content-type: text/xml; charset="UTF-8"\r\n
    Content-length: 416\r\n
        [Content length: 416]
    \r\n

    <idigi_data
        compact="True">
        <sample
            name="XBee_415B3C2C.var1"
            timestamp="2017-07-10T13:19:05-06:00"
            unit="u1"
            value="1"/>
        <sample
            name="XBee_415B3C2C.var2"
            timestamp="2017-07-10T13:19:05-06:00"
            unit="u2"
            value="1"/>
        <sample
            name="XBee_415B3C2C.var1"
            timestamp="2017-07-10T13:19:05-06:00"
            unit="u1"
            value="0"/>
        <sample
            name="XBee_415B3C2C.var2"
            timestamp="2017-07-10T13:19:05-06:00"
            unit="u2"
            value="1"/>
        </idigi_data>

    HTTP/1.1 400 Bad Request\r\n
        Request Version: HTTP/1.1
        Status Code: 400
        Response Phrase: Bad Request
    Server: Apache-Coyote/1.1\r\n
    Set-Cookie: JSESSIONID=BE6A91B157E9ACDB1077507AC228CEFF; Path=/ws/; HttpOnly;Secure\r\n
    Cache-Control: no-store\r\n
    Pragma: no-cache\r\n
    Expires: Thu, 01 Jan 1970 00:00:00 GMT\r\n
    Content-Type: application/xml;charset=ISO-8859-1\r\n
    Date: Mon, 10 Jul 2017 19:20:19 GMT\r\n
    Connection: close\r\n
    \r\n
    <wsError>
        <request>
            <path>
                /ws/device/xig_1499714370367.xml
                </path>
            </request>
        <error>
            <code>
                400
                </code>
            <message>
                API Deprecated
                </message>
            </error>
        </wsError>
Avocadodude commented 7 years ago

To answer the first question, yes; I use this on several devices (although Windows 10 is not one of them). I have Connectport X2, x2d, X2e, and X4 and they run perfectly.

I'm not familiar with the "XIG - XBee Internet Gateway Leds and Buttons Example" tutorial so I'll have to go look at it. I just wanted to send a quick response to let you know someone at least saw your question. I'll try to get to it tonight.

firmwareguru commented 7 years ago

That's great to hear!

I haven't delved into the Device Cloud API yet, but my guess is that the URL "/ws/device/xig_1499714370367.xml" doesn't cut it anymore. Are you saying that you're running XIG 1.5.2, as obtained from this repository, on your ConnectPorts, having replaced the application that was already on them?

prichardson commented 7 years ago

I was having trouble with 1.5.2 (forget what) and switched to 1.5.1 which I use daily on a ConnectPort x2 without issue.

On Mon, Jul 10, 2017 at 11:03 PM, Evan Ross notifications@github.com wrote:

That's great to hear!

I haven't delved into the Device Cloud API yet, but my guess is that the URL "/ws/device/xig_1499714370367.xml" doesn't cut it anymore. Are you saying that you're running XIG 1.5.2, as obtained from this repository, on your ConnectPorts, having replaced the application that was already on them?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/XBeeInternetGateway/XIG/issues/47#issuecomment-314309828, or mute the thread https://github.com/notifications/unsubscribe-auth/AF2M0YcW7txUshn9LOPXae90R-HceHNEks5sMuYHgaJpZM4OTUm6 .

RobMBSos commented 7 years ago

Hi! Same here, I am still using 1.5.1 on daily basis in 8 ConnectPort X4H. Had same problem as you in a new one and switched again to 1.5.1 wasn¡'t able to find the problem. Regards!

firmwareguru commented 7 years ago

Thanks for your help, but all I can really say at this point is that the content of either of these archives:

when run on my Windows 10 PC, no longer works with Device Cloud.

I believe it is due to Device Cloud API changes/deprecation. I don't have time to figure out how to update XIG to work with the Device Cloud API described here: https://www.digi.com/resources/documentation/Digidocs/90001437-13/default.htm, so I'll just buy a ConnectPort X2.

firmwareguru commented 7 years ago

I've acquired a ConnectPort X2, and yes, the 1.5.2 XIG Python scripts for the X2 Python 2.4 (because this X2 has Python 2.4.3 on it) do work. The "idigi_data" command strings sent from the nodes will get uploaded to device cloud. So it is the Windows version of XIG that has fallen by the wayside (among other things).

In summary, this works on ConnectPort X2 hardware: https://github.com/XBeeInternetGateway/XIG/releases/download/v1.5.2/xig_connectport_1.5.2-py2.4.zip

Cheers!

prichardson commented 6 years ago

Hi Even... Seems you got this work out using a Connectport X2. If anyone else would like to use the XIG on a windows machine this still does work. See my blog post here. I have this system running daily on Windows 10.

https://internetofcoolthings.wordpress.com/2016/04/10/control-a-led-from-the-internet/

On Wed, Jul 12, 2017 at 11:50 PM, Evan Ross notifications@github.com wrote:

Thanks for your help, but all I can really say at this point is that the content of either of these archives:

when run on my Windows 10 PC, no longer works with Device Cloud.

I believe it is due to Device Cloud API changes/deprecation. I don't have time to figure out how to update XIG to work with the Device Cloud API described here: https://www.digi.com/resources/documentation/ Digidocs/90001437-13/default.htm, so I'll just buy a ConnectPort X2.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/XBeeInternetGateway/XIG/issues/47#issuecomment-314962957, or mute the thread https://github.com/notifications/unsubscribe-auth/AF2M0bF-6qhvfarSxtamxFyK3EunKdApks5sNZQTgaJpZM4OTUm6 .