-
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] Server-Side RPC: Receiving Attributes doesn't work #107
Comments
See #91 for a longer description on the issue you probably have. The short version is that to receive RPC messages the PayloadSize you are allowed to receive, has to be increased. If that is not done the PubSubClient simply discards the received message. Therefore replace |
First of all thanks for the quick response @MathewHDYT ! I tried this out, but it sadly didn't make a difference, since i still dont receive client attributes :( Other question: Does it make sense to include the in the sendAttribute...l()-function in the RPC-Response method? Like this for example (<-- is the indicator for the added lines):
|
I think I might know a possible issue, in the comment above you mentioned server side attributes, those can not be read or written to be the client, for the shared attributes they are read only. So what you are sending with the And sending the attribute directly in the RPC callback method should work, at least it worked on my device. |
Good to know might It be possible to switch to the newest version 0.8.0 and try it again. |
This could help. Im using version 0.6 becasue i had issues with libraries in 0.7.1. I will keep you postd |
So this is the error i get when i use 0.7.1 :
And this is the error i get using 0.8 :
|
I knew 0.7.1 had thoose issues that's why I attempted to fix them, it's interesting tough that it has problems finding the mbedtls/md.h library inv ersion 0.8.0 Might I know what device you are using is it an Arduino Uno perhaps so neither an ESP32 or ESP8266? |
Im using a NodeMCU with a ESP8266(MOD)-Chip |
Could you try to include this library https://github.com/Seeed-Studio/Seeed_Arduino_mbedtls. It should make it possible to use the functionality of mbedtls/md.h on the ESP8266, that is natively supported on ESP32. Sorry for the inconvenience. |
I doesnt find the header file, when i include this line: Do i have to specify the path of the header`? |
I think it should be fine to simply just download the library the same way PubSubClient has been downloaded and the include should stay |
What happens if you don't include the library in your main file and then recompile? |
You mean like this |
Yeah just remove that line and recompile. |
Sorry for asking but did you add the library the same way you add the PubSubClient and ArduinoJson library. |
What happens if you download the library over Sketch > Include Library > Manage Libraries and then search for |
Can you replace the include statement with this one instead. In the HashGenerator.h file That's the include they had in their example file. |
Can you remove the old include |
Finally a new error haha:
Here the connectRPC() function
|
Okay perfect those errors are just because the API changed a bit. Just have a look in the examples folder in the ThingsBoard Library more exactly the RPC example and adjust it to be similar to that one. |
Okay i changed the code to this:
This is the error i get now:
|
Could you also send the code for the callback array itself, because that seems to be the error. I'm assuming it is still a normal c-style array |
So it does send but it is a telemetry instead of attribute data value? |
No i was just exclude the mistake of using a wrong device token. |
This is really really weird the communication with the server is up, sending values does return true. RPC works, Telemetry works as well i think? But attributes do not... |
Problem solved. I forgot to add the 'Save Attributes'-Node and the 'Post Attributes' in my Root Rule Chain. |
Regarding the 0.8.0 issue: I tried to install the ExceptionDecoder as proposed by you. Sadly there seems to be an issue with IDE 2.0.1. (#58). I followed the instructions. But the tool doesn't show up on my UI: Here is the exception i received:
|
Sad to know that it doesn't work with Arduino IDE currently, because that would have made it easier for you alternatively you can use this library EspStackTraceDecoder, it's a little more work but it should work even without the Arduino IDE. You need to put the .jar script of this respository into a folder, that folder also needs to contain the .elf file (automatically created when building the project, copy it from the build folder, it also needs a .txt with the Stacktrace copied into it and then you should be able to execute the .jar and give the path to the files as command line arguments. |
Where do I find the build folder? |
I sadly don't really know how the Arduino IDE works, but I guess navigating to the project on the filesystem in the File Explorer and then seeing if there is a build folder there somewhere might work the easiest. |
I followed this this method and found the .elf-file. Let me try the EspStackTraceDecoder now. |
Do you mean like this? : And also i dont really understand what they mean by this. :
Im running the the java file using Visual Studio Code. |
You can simply run the VSCode file via. the command shell, simply open the folder in the command shell where your files are located and then enter the command. |
What do mean by that? You mean the As you can see there is no such .exe. I looked it up on the internet and found this. But it's not an .exe either. Also i found this issue.
So i replace the placeholders with the name of the files, right (e.g. |
Yeah exactly because it wants a path you might need to add For the executable I'll have a look later if I can find the file on my machine and how it is called, for now can you try just downloading the xtensa file you found and trying to run that and see if it does anything. |
I converted the downloaded file by adding This is what his how my cmd line looks like:
This is the output:
|
EspEception Probably needs to be EspStackTraceDecoder instead |
Same issue. I upload the files as .zip in my previous message. |
Could you use this command instead just to try if the paths are the issue. java -jar .\EspStackTraceDecoder.java ".\xtensa-lx 106-elf-addr2line" .\code.elf .\exeception.txt |
|
I looked it up the jar file itself doesn't seem to need to be a path java EspStackTraceDecoder ".\xtensa-lx 106-elf-addr2line" .\code.elf .\exeception.txt I'll try it on my machine in a while |
Okay, do that :) Let me know if you need something. |
Okay I found the issue:
The output I got was
|
I hope it helps you troubleshooting 0.8.0 :) |
Description
Hey guys,
i'm currently working on a server-side rpc application. I basically want to turn on an analog LED via TB.
The later works fine (see picture), but when I also want to mirror the analog led on my dashboard, like in this tutorial. Therefore I created a server-side attribute called 'ledStatus' and linked an led indicator to its changes. To send the status i use this TB-function for example:
client.sendAttributeBool("ledStatus", ledStatus);
The problem is that TB doesn't seemt to receive the change of the ledStatus. Am I missing something? Do i maybe have to make a rule chain to process information coming from the device?
I hope my problem is kind of understandable. Suggestions are always appreciated :)
Greetings
Reno
Here is the current code. I use the Arduino IDE for coding:
Environment
The text was updated successfully, but these errors were encountered: