kolinger / rd-usb

Web GUI for RuiDeng/Riden USB testers (UM34C, UM24C, UM25C, TC66C)
GNU General Public License v3.0
223 stars 29 forks source link

How to get json data? #10

Closed DjordjeMandic closed 3 years ago

DjordjeMandic commented 3 years ago

I wanna know how i can get json data thats shown in "Log" tab? I would like to use that to parse it in my own program and transfer it via mqtt. It could also be useful if this had mqtt support built in and url for http get requests that return last received json.

kolinger commented 3 years ago

You can't as of now. All data is stored into local sqlite database and can be exported to CSV. There is no other way of exporting.

Implementing specific way/protocol (for example MQTT) may not be useful for other people. Other people may want different protocol or different layout for mqtt message. I would like to help you but I want some universal solution that anyone can use with any protocol.

What about adding new parameter for CLI. Where you can specify program or bash script to be called when new data is received? Then you can put your mqtt code into this program/script and do whatever you want. Is this acceptable solution to your problem?

metawops commented 3 years ago

This any help? 😳

kolinger commented 3 years ago

MQTT is usually used for continuous/real time measurements as they happen and this can't be accomplished with current implementation. I don't believe this is about CSV vs JSON but more about how export works.

kolinger commented 3 years ago

I'm closing this issues since no progress was done. I did implement my proposed solution - it can be used in latest version (see https://github.com/kolinger/rd-usb#custom-export) it should be good enough to workaround this problem and other similar ones.