-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question] Function for Client-Side RPC #110
Comments
I'm not sure what you mean, client side rpc is meant for you send a command to the cloud, meaning you might send a json containing a method called "getTime", and then the cloud will send you back a response containing the current timestamp. But using it for simply sending data to the cloud doesn't make sense. Could you explain your use case a little bit further, sorry for the confusion. I'm not sure but it could also be that you mean server-side RPC, that is when the server sends a message including a method name "getTemperature" and you return a message containing the current value which can then be displayed. |
I want to clear an alarm locally by pushing a button. Right now i'm doing so by updating the client attribute |
Yeah okay that would make sense to integrate client side RPC for, if you could wait a while I might be able to integrate it in the next few days. I am currently working on an update to the OTA firmware update as well to allow a passive ota update (update starts as soon as the firmware is assigned to the device), as well as a call-back that tracks the progress of the download. If it is very urgent you could also try it yourself, you can probably copy and inspire yourself with the Shared Attribute Request API, because it seems very similar, you request something and then get a response once, afterwards the callback can be cleared. |
I will stick with my solution for now since i'm running out of time for my master thesis. But I will try it when i have time. |
Sadly couldn't completely finish the client side RPC implementation, but everything besides handling a possible response from the server is implemented, will probably try to finish that tomorrow. It will probably be completely tested and implemented friday evening. |
Very cool man! I will try out the client-side RPC and let you know if it worked. |
Everything should at least on my ESP32 it does (at least the client-side RPC, changed some other stuff as well), but the optional response is still bugged shouldn't matter for your use case tough. Will try to fix that as well might need a while tough. |
Could it be that |
The include has been added but only if you are actually using an ESP8266 board instead of an ESP32 board, but I didn't compile that code and got the Stack-trace, I just decoded yours? Sorry if I misunderstand. |
I was getting the an error we discussed in #107: So I applied the same troubleshooting (adding
Sadly I'm still getting Exceptions with the 0.8.0.. I used your updated fork. Here are the .zip containg the .elf-file and the exception I'm getting:
Let me know if you need something from me. |
Sorry for the confusion could you download the fork off this branch: https://github.com/MathewHDYT/thingsboard-arduino-sdk/tree/feat_examples Because the changes are on that branch and not the main one so the version you downloaded is still the same as the main repository. Would be nice if you could then recompile again. Sorry for the inconvenience. That should also fix any compilation errors on the ESP8266. |
Ah, okay this probably also explains why I had this error again. Still getting an exception though :( Code_Aktuator_TBv080.ino.zip <- elf.-file
I just saw that there's an update for the esp8266 boards. I'll try again |
Will check it tomorrow, but as before I am still pretty confused what could actually cause the issues. Could you try to compile an test the examples for the ESP8266 in the examples folder and see if you get an exception there as well. Would be highly appreciated. |
I only can imagine how annoying this must. I'll report back! |
Same error after updating the ESP8266 board manager from 3.0.0 to 3.1.0:
When i try to compile your rpc example. Is this maybe caused by me using an ESP8266`?
|
Decoded Stacktrace:
and the error you get for the RPC example is also really werid, it seems to simply call The weird things Is i adjusted PlattformIO to build for ESP8266 instead and the RPC example does compile for me. What type of ESP8266 are you using (what board is it connected too)? And just to try can you define your constants like this
instead of |
It seems someone else has the exact same problem and their stacktrace makes more sense, I'm assuming the stacktrace I got wasn't correct, because they seem to crash on the |
Hey @MathewHDYT , is there an example for client-side RPC? Greetings Reno |
Here is an example it uses the |
@imbeacon This can be closed as solved, client side RPC has been implemented and works well on the ESP32. |
Hello guys,
i'm trying to perform client-side RPCs. The problem is that there's no predefined function for that in the SDK.
What would be the best way to realize them? I know that I have to subscribe the client to
v1/devices/me/rpc/request/$request_id
. Sadly i'm not to familiar with the architecture of the SDK. Would it make sense to modfiy this code snippet (v0.6.1)?:Also this could be a nice feature for a future release.
My use case is that i want to send data from my client to TB when i press a button. The workaround that I was working is updating client attributes, but I think client RPCs would be more efficient and flexible.
Greetings
Reno
The text was updated successfully, but these errors were encountered: