Skip to content
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

Connection to CoAP server #1

Open
ce237 opened this issue Oct 28, 2021 · 12 comments
Open

Connection to CoAP server #1

ce237 opened this issue Oct 28, 2021 · 12 comments

Comments

@ce237
Copy link

ce237 commented Oct 28, 2021

Hello,

please can you tell me how you got your connection with the californium server?

Thanks in advance

Cedric

@simensrostad
Copy link
Owner

The server implementations can be found in this repo, https://github.com/simensrostad/sw-iot-test-servers.

@simensrostad
Copy link
Owner

But I would suggest running a new version of the californium framework.

@ce237
Copy link
Author

ce237 commented Oct 28, 2021

Thanks for your reply.

But I would suggest running a new version of the californium framework.

Do you mean this one : https://github.com/eclipse/californium ?

I am using Intellij to run californium.

Or what do you mean with "new version of the californium framework"?

@simensrostad
Copy link
Owner

Alright, so you already have an instance running. Then you need to ensure that the correct hostname and DTLS credentials are used.

@ce237
Copy link
Author

ce237 commented Oct 28, 2021

And to make sure the correct hostname and DTLS credentials are used, i have to check the server's properties?

or how can i do it?

sorry for too questions

@simensrostad
Copy link
Owner

I would read up on documentation on the californium framework / the SDK the firmware is based on. Basically you have to identify the hostname on the instance you are running californium on, the IP address and port. Then if you are using DTLS you have to generate certificates and provision them to the device you are running the firmware on.

https://www.eclipse.org/californium/
https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/index.html

@ce237
Copy link
Author

ce237 commented Oct 28, 2021

Basically you have to identify the hostname on the instance you are running californium on, the IP address and port.

The instance in this case will be my PC? Since i am running californium using my PC

@ce237
Copy link
Author

ce237 commented Oct 28, 2021

Here is my code may be you can please test, if you have time and see if it works for you:

main.zip

@simensrostad
Copy link
Owner

I'm sorry, but I would encourage you to contact https://devzone.nordicsemi.com/ for issues related to the nRF9160. I don't have time.

@ce237
Copy link
Author

ce237 commented Oct 28, 2021

Thanks for your support

@ce237
Copy link
Author

ce237 commented Nov 2, 2021

Hi @simensrostad

sorrying for bordering you once again, but i have a question:

How did you initiate a communication with the californium server after your device come out of the PSM (Sleeping mode) in DTLS session?

I will really appreciate having your thoughts on that.

@simensrostad
Copy link
Owner

It depends. Some networks have really short NAT timeouts. In those cases you will need to perform a new DTLS handshake for every UDP packet transmission, if your packet transmission interval supersedes the NAT timeout.

If you manage to send data within this timeout, you most likely can use the same session key that has already been negotiated with the server during the DTLS handshake. From the fw perspective, you simply continue to push data on the DTLS/UDP socket. PSM shouldn't play a part in this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants