Comments (8)
Ok, I found the reason. When looking in Wireshark, the CoAP response indicates a Content-Format value that node-wot does not understand.
To solve this, the CoAP request sent from node-wot would have to indicate that it accepts text/plain.
from node-wot.
Hi,
I think you can just do that by specifying text/plain
as mediaType
in the forms
of your property specification in the TD. Default is application/json
AFAIK.
from node-wot.
I have the following in my TD:
"forms":[{"href":"coap://193.234.219.199:5683/3303/0/5700","mediaType":"text/plain"}]
But, it does not have any impact on the request.
from node-wot.
I just have seen that @mkovatsc commented line https://github.com/eclipse/thingweb.node-wot/blob/20fdc5b2ea0f95e6e2d24d73dd0100e5f7b39e5f/packages/binding-coap/src/coap-client.ts#L191 a month ago. This line had set the Accept
option before. We would have to ask him for the reason of this change.
from node-wot.
Just talked to him. There was another CoAP server implementation which could not cope with Accept
headers, so he removed it to make this working. Until a final solution is found to fit both requirements you might just uncomment the line again locally.
from node-wot.
I think the master branch should be based on endpoints behaving correctly - in this case being able to process the Accept header :)
Anyway, I will see Matthias this weekend, so I can discuss it with him then. Short term I will uncomment the line.
from node-wot.
The code
req.setOption("Accept", form.mediaType);
is activated again.
@cdh4u Can we close the issue?
from node-wot.
as mentioned the option is in by default now, see https://github.com/eclipse/thingweb.node-wot/blob/6dad9786152e40f939caa7f63ef1abf1769ef316/packages/binding-coap/src/coap-client.ts#L212
from node-wot.
Related Issues (20)
- Upgrading to ES2021 HOT 2
- allowSelfSigned not working for requestThingDescription HOT 4
- findProtocol SHOULD NOT require base HOT 4
- CI - Add Node.js 22 to CI tests
- CoAP issue on local machine (Windows) - nO HOT 2
- Async actions should not try to validate the value according DataSchema
- action and event affordance do not raise error when data schema does not match HOT 1
- events without subprotocol might be causing unexpected behaviour HOT 3
- Export WoT implementation type
- Modbus Test issue with modv:function HOT 1
- Issue with void-obj of Test Thing HOT 1
- Follow-up on validating output for (async) actions
- Re-creating package-lock.json fails HOT 7
- observe property deserialized value (may) not (be) completely consistent HOT 5
- Deprecating tm-helpers from node-wot HOT 3
- [test] Convert unhandledRejection to uncaughtException
- TODOs after major release
- Re-activate mbus tests on Windows
- two netconf-codec.ts files
- Replacing Protocol and Port Detection HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-wot.