API: 501 Not Implemented #2

Open
opened 2022-01-28 11:41:59 -07:00 by jebba · 5 comments
Collaborator

Hits to the API always return 501 Not Implemented.

Hits to the API always return `501 Not Implemented`.
jebba added the
bug
label 2022-01-28 11:41:59 -07:00
Poster
Collaborator

SciAps API repo:

https://github.com/SciAps/SciApsApi

Raw Spectra Acquisition
These commands relate to acquiring spectra only

...

/api/v2/acquire


This endpoint is used to initiate raw spectra acquisition. Individual spectra will be returned if all is passed as the last segment of the URL. Only the final, averaged spectra will be returned if finalis passed as the last segment of the URL. This endpoint requires a mode to be passed which can be obtained from the apps field of the InstrumentId object. Details of the ZAcquisitionResult object can be found here

Example usage:

$ curl -X POST -H "Content-Type: application/json" -d @settings.json --output output.json http://192.168.42.129:8080/api/v2/acquire/all?mode=Alloy

Links to:

https://github.com/SciAps/SciApsApi/blob/master/api/src/main/java/com/sciaps/ZAcquisitionResult.java

Contents:

package com.sciaps;

import java.util.List;

public class ZAcquisitionResult {
    public String status;
    public boolean abortedByUser;
    public int errorCode;
    public List<ZSpectrum> spectra;
    public ZAcquisitionMetadata metadata;
}

It looks like the API isn't implemented though? Basic queries return not implemented.

$ curl -v http://192.168.1.1:8080/api/v2/id
*   Trying 192.168.1.1:8080...
* Connected to 192.168.1.1 (192.168.1.1) port 8080 (#0)
> GET /api/v2/id HTTP/1.1
> Host: 192.168.1.1:8080
> User-Agent: curl/7.81.0
> Accept: */*
> 
* Mark bundle as not supporting multiuse
< HTTP/1.1 501 Not Implemented
< Date: Tue, 25 Jan 2022 16:00:55 GMT+00:00
< Content-Length: 0
< Connection: Close
< 
* Closing connection 0

The device gives itself the static IP 192.168.42.129. It still listens with the webserver on all ports. The device itself has curl on it. So you can run that directly on the device, using that static IP as a test as well (e.g. there's nothing else in between could cause an issue). That also gives 501 Not Implemented.

root@ngl:/ # curl -v http://192.168.42.129:8080/api/v2/id                      
* About to connect() to 192.168.42.129 port 8080 (#0)
*   Trying 192.168.42.129... connected
* Connected to 192.168.42.129 (192.168.42.129) port 8080 (#0)
> GET /api/v2/id HTTP/1.1
> User-Agent: curl/7.21.3 (arm-unknown-eabi) libcurl/7.21.3 OpenSSL/1.0.1j zlib/1.2.8
> Host: 192.168.42.129:8080
> Accept: */*
> 
< HTTP/1.1 501 Not Implemented
< Date: Tue, 25 Jan 2022 16:05:54 GMT+00:00
< Content-Length: 0
< Connection: Close
< 
* Closing connection #0

The URL endpoint appears correct:

https://github.com/SciAps/SciApsApi/blob/master/client/app/src/main/java/com/sciaps/apidemo/SciApsClient.java#L59

String url = String.format("http://%s/api/v2/%s", mInetSocketAddress.getHostString(), endpoint);

The X-555 gives the same 501 Not Implemented when using the API. It is able to get an IP via wifi and start the service on port 8080, which answers, but always 501.

root@ngx:/ # curl -v http://192.168.42.129:8080/api/v2/id                      
* About to connect() to 192.168.42.129 port 8080 (#0)
*   Trying 192.168.42.129... connected
* Connected to 192.168.42.129 (192.168.42.129) port 8080 (#0)
> GET /api/v2/id HTTP/1.1
> User-Agent: curl/7.21.3 (arm-unknown-eabi) libcurl/7.21.3 OpenSSL/1.0.1j zlib/1.2.8
> Host: 192.168.42.129:8080
> Accept: */*
> 
< HTTP/1.1 501 Not Implemented
< Date: Thu, 27 Jan 2022 22:20:41 GMT+00:00
< Content-Length: 0
< Connection: Close
< 
* Closing connection #0

The X-555 also apparently statically assigns itself the address 192.168.42.129. This could be a potential conflict on that IP if both units/models are used at the same time on the same network.

Looks like the 192.168.42.129 is in Airdroid.odex.

From bug #1.

SciAps API repo: https://github.com/SciAps/SciApsApi ``` Raw Spectra Acquisition These commands relate to acquiring spectra only ... /api/v2/acquire This endpoint is used to initiate raw spectra acquisition. Individual spectra will be returned if all is passed as the last segment of the URL. Only the final, averaged spectra will be returned if finalis passed as the last segment of the URL. This endpoint requires a mode to be passed which can be obtained from the apps field of the InstrumentId object. Details of the ZAcquisitionResult object can be found here Example usage: $ curl -X POST -H "Content-Type: application/json" -d @settings.json --output output.json http://192.168.42.129:8080/api/v2/acquire/all?mode=Alloy ``` Links to: https://github.com/SciAps/SciApsApi/blob/master/api/src/main/java/com/sciaps/ZAcquisitionResult.java Contents: ``` package com.sciaps; import java.util.List; public class ZAcquisitionResult { public String status; public boolean abortedByUser; public int errorCode; public List<ZSpectrum> spectra; public ZAcquisitionMetadata metadata; } ``` It looks like the API isn't implemented though? Basic queries return `not implemented`. ``` $ curl -v http://192.168.1.1:8080/api/v2/id * Trying 192.168.1.1:8080... * Connected to 192.168.1.1 (192.168.1.1) port 8080 (#0) > GET /api/v2/id HTTP/1.1 > Host: 192.168.1.1:8080 > User-Agent: curl/7.81.0 > Accept: */* > * Mark bundle as not supporting multiuse < HTTP/1.1 501 Not Implemented < Date: Tue, 25 Jan 2022 16:00:55 GMT+00:00 < Content-Length: 0 < Connection: Close < * Closing connection 0 ``` The device gives itself the static IP `192.168.42.129`. It still listens with the webserver on all ports. The device itself has `curl` on it. So you can run that directly on the device, using that static IP as a test as well (e.g. there's nothing else in between could cause an issue). That also gives `501 Not Implemented`. ``` root@ngl:/ # curl -v http://192.168.42.129:8080/api/v2/id * About to connect() to 192.168.42.129 port 8080 (#0) * Trying 192.168.42.129... connected * Connected to 192.168.42.129 (192.168.42.129) port 8080 (#0) > GET /api/v2/id HTTP/1.1 > User-Agent: curl/7.21.3 (arm-unknown-eabi) libcurl/7.21.3 OpenSSL/1.0.1j zlib/1.2.8 > Host: 192.168.42.129:8080 > Accept: */* > < HTTP/1.1 501 Not Implemented < Date: Tue, 25 Jan 2022 16:05:54 GMT+00:00 < Content-Length: 0 < Connection: Close < * Closing connection #0 ``` The URL endpoint appears correct: https://github.com/SciAps/SciApsApi/blob/master/client/app/src/main/java/com/sciaps/apidemo/SciApsClient.java#L59 ``` String url = String.format("http://%s/api/v2/%s", mInetSocketAddress.getHostString(), endpoint); ``` The X-555 gives the same `501 Not Implemented` when using the API. It is able to get an IP via wifi and start the service on port `8080`, which answers, but always `501`. ``` root@ngx:/ # curl -v http://192.168.42.129:8080/api/v2/id * About to connect() to 192.168.42.129 port 8080 (#0) * Trying 192.168.42.129... connected * Connected to 192.168.42.129 (192.168.42.129) port 8080 (#0) > GET /api/v2/id HTTP/1.1 > User-Agent: curl/7.21.3 (arm-unknown-eabi) libcurl/7.21.3 OpenSSL/1.0.1j zlib/1.2.8 > Host: 192.168.42.129:8080 > Accept: */* > < HTTP/1.1 501 Not Implemented < Date: Thu, 27 Jan 2022 22:20:41 GMT+00:00 < Content-Length: 0 < Connection: Close < * Closing connection #0 ``` The X-555 also apparently statically assigns itself the address `192.168.42.129`. This could be a potential conflict on that IP if both units/models are used at the same time on the same network. Looks like the `192.168.42.129` is in `Airdroid.odex`. From bug #1.
Poster
Collaborator

No word from Sciaps.

No word from Sciaps.
Collaborator

Need to re-test API with new firmwares.

Need to re-test API with new firmwares.
Collaborator

New X-555 firmware still gives 501s.

New X-555 firmware still gives 501s.
Poster
Collaborator

No word from SciAps.

No word from SciAps.
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: spacecruft/pysalx#2
There is no content yet.