testo / tjf

Schema definitions of the Testo JSON format (tjf). Used in t300 / t330 / t330i / t400 / t420 / SmartProbes / t550 / t557 / t550s / t557s / testo Smart
https://www.testo.com
Apache License 2.0
6 stars 3 forks source link

Binary data in HTTP answer from T400 #20

Open Gunni0408 opened 10 months ago

Gunni0408 commented 10 months ago

I connect to a T400 via Wifi. DataControl software is working. UDP package is sent every second with device information (ip, port, serial). Scanned with WireShark. So far OK.

But when I try to send a simple command with curl or use a browser, I only get an answer with 8 binary bytes: curl -X GET "http://192.168.5.173:53956/deviceInfo"

03 00 00 00 00 00 00 28

What is my mistake?

gwaldvogel commented 10 months ago

Hi @Gunni0408 the port 53956 is used for the binary communication between testo 400 and Data Control, to use the HTTP interface please try port 54000.

Gunni0408 commented 10 months ago

Hi Mr. Waldvogel,

when I try: curl -X GET "http://192.168.5.173:54000/deviceInfo" or any other command I receive the answer:

HTTP/1.1 404 Not found ! Server: HTTP SERVER Content-Length: 0 Access-Control-Allow-Origin: * Date: Mi., 23 Aug. 2023 12:26:33 UTC

Just for info: In the UDP message the HTTP port is defined as 53956!

[{"AppVersion":"17.7.11.70192","DeviceId":"testo 400","FirmwareVersion":"1.1.4","HttpServerIPv4":"192.168.5.173","HttpServerPort":53956,"Serial":"64159185"}

gwaldvogel commented 10 months ago

Please try again with the correct route for testo 400: curl -X GET "http://192.168.5.173:54000/api/deviceInfo" The HttpServerPort in the UDP broadcast is unfortunately the wrong name, this is a known issue but hasn't been changed yet because of historical reasons.

Gunni0408 commented 10 months ago

Hi, OK, now I get the device information.

gwaldvogel commented 10 months ago

Via /api/data/live you can fetch the live data that is displayed on the testo 400. Not sure how exactly the WiFi behaves when the testo 400 enters standby. I think it will be disabled after a while to save power. I will verify this again with my colleagues.

gwaldvogel commented 10 months ago

@Gunni0408 I just verified with my colleagues, the testo 400 should stay connected, even in standby, as long as it is connected to the charger.

Gunni0408 commented 10 months ago

This is not the case. I have added the T400 to our professional data acquisition software with a sample rate of 1s, T400 standby after 10 min. Device is connected to power supply via USB (not a computer). For 10 minutes I get the data, then connection is lost. When I pressed the button on the device, the connection is reset and data is coming again. The device is fully charged and I can see the charging symbol.

gwaldvogel commented 10 months ago

I just realised that as well, my colleague was thinking about the Bluetooth connection, not Wifi. Unfortunately we do not have the option in the testo 400 right now, to keep the connection up while the device enters standby.

Gunni0408 commented 10 months ago

Is there a chance of fixing the firmware?

gwaldvogel commented 10 months ago

I can't promise anything, but we will discuss this internally and see if we can find a solution for you.

gwaldvogel commented 4 months ago

@Gunni0408 sorry for leaving you in the dark so long. I can now confirm that the interface will be available while the device is in standby starting from the next release. Unfortunately I can not give you a specific release date yet.

Gunni0408 commented 4 months ago

Thanks for the improvement. I guess the new release can be updated by the instrument?

gwaldvogel commented 4 months ago

Thanks for the improvement. I guess the new release can be updated by the instrument?

Yes, as soon as the update is released it will automatically show up on your instrument, as long as the device is connected to the internet.