Skip to content

Instantly share code, notes, and snippets.

@jaimejim
Created March 25, 2023 14:26
Show Gist options
  • Save jaimejim/a3cfbe4e4179a5769c0437c86f08604a to your computer and use it in GitHub Desktop.
Save jaimejim/a3cfbe4e4179a5769c0437c86f08604a to your computer and use it in GitHub Desktop.
aicoap returns 5.00
When trying
./aiocoap-client -m PUT coap://127.0.0.1:5683/ps --payload "{\"topic_name\": \"Room Temperature Sensor\", \"resource_type\": \"core.ps.conf\", \"media_type\": \"application/json\", \"target_attribute\": \"temperature\", \"expiration_date\": \"2023-04-05T23:59:59Z\", \"max_subscribers\": 100}"
i get this error
File "/Users/ejajimn/code/aiocoap/aiocoap/pipe.py", line 196, in wrapped
await coroutine
File "/Users/ejajimn/code/aiocoap/aiocoap/protocol.py", line 370, in _render_to_pipe
return await self.serversite.render_to_pipe(pipe)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ejajimn/code/aiocoap/aiocoap/resource.py", line 436, in render_to_pipe
return await child.render_to_pipe(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ejajimn/code/aiocoap/aiocoap/resource.py", line 145, in render_to_pipe
return await interfaces.Resource._render_to_pipe(self, request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ejajimn/code/aiocoap/aiocoap/interfaces.py", line 348, in _render_to_pipe
res = await self._block2.extract_or_insert(req, lambda: self.render(req))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ejajimn/code/aiocoap/aiocoap/blockwise.py", line 111, in extract_or_insert
assembled = await response_builder()
^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ejajimn/code/aiocoap/aiocoap/resource.py", line 118, in render
response = await m(request)
^^^^^^^^^^^^^^^^
File "/Users/ejajimn/code/aiocoap/server.py", line 99, in render_put
self.root.add_resource([path_segments, topic_data], TemperatureResource())
File "/Users/ejajimn/code/aiocoap/aiocoap/resource.py", line 397, in add_resource
self._resources[tuple(path)] = resource
~~~~~~~~~~~~~~~^^^^^^^^^^^^^
TypeError: unhashable type: 'list'
DEBUG:coap-server:Sending message <aiocoap.Message at 0x106e6bfd0: 2 5.00 Internal Server Error (MID 23920, token 7f14) remote <aiocoap.transports.simplesocketserver._Address via <aiocoap.transports.simplesocketserver._DatagramServerSocketSimple object at 0x107ff6650> to ('127.0.0.1', 56536)>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment