guild icon
Toit
#Get signal strength from modem
Thread channel in help
Rikke
Rikke 04/17/2023 10:00 AM
Hello,

I would like to get the rssi from my toit device running with sequans modem. I can see the function signal_strength -> float?: from cellular package cellular/src/base/base.toit line 119 does exactly what I want.
My problem is I can't find a way to get the value from the monarch container, and use it in a different container.
In the cellular/src/base/service.toit file I can call the function using driver.signal_strength and get the value I expect. But I can only print it out on serial log.
I've tried to save the service when opening the network, but this is CellularServiceClient and I need CellularServiceProvider.

Have I missed the simple way of getting the signal strength from modem, or is it supposed to be difficult to get hands on the uart connected to modem?
bitphlipphar
bitphlipphar 04/17/2023 10:26 AM
The function needs to be part of the cellular service API and it isn't right now. I can help with that. I'm going to add it to https://github.com/toitlang/toit/blob/master/lib/system/api/cellular.toit and then we'll let the cellular providers implement it. It will take a few days to pipe through. In the mean time, you could save it in RTC memory using a storage.Bucket in the cellular provider and then fetch it from the same bucket in the client.
Program your microcontrollers in a fast and robust high-level language. - toit/cellular.toit at master ยท toitlang/toit
Rikke
Rikke 04/17/2023 10:30 AM
Okay thanks, I thought it was fully implemented when I saw the function :๐Ÿ™‚: no need to rush, I just wanted to know if it was me missing something obvious
Rikke
Rikke 04/17/2023 10:31 AM
So far the modem implementation is very stable. I havent seen it go offline yet
๐Ÿ‘Œ1
Rikke
Rikke 05/10/2023 07:41 AM
Hello, will the api to get the signal strength and other values, be a part of the new service design/update?
bitphlipphar
bitphlipphar 05/12/2023 05:25 AM
I will look at this today! Do you have time for a quick chat here on Discord if I have questions on your requirements?
Rikke
Rikke 05/12/2023 06:14 AM
Sure :๐Ÿ™‚:
bitphlipphar
bitphlipphar 05/12/2023 06:17 AM
I am thinking two floats in the range [0,1] representing signal strength and quality respectively.
Rikke
Rikke 05/12/2023 06:19 AM
That is fine, i will write a few words about all the things we have planned
bitphlipphar
bitphlipphar 05/12/2023 06:20 AM
Do you need the information to be available when the connection is closed?
Rikke
Rikke 05/12/2023 06:20 AM
What we really need from the simcard is a few values:
IMEI with AT+CGSN=1 giving us OK and the IMEI itself. Ive tested it and we can easily print it in the cellular/internet service.

It would be amazing if we could get info on connection closed yes
(edited)
Rikke
Rikke 05/12/2023 06:21 AM
I can see theres already function to get the APN, but I havent played around with it yet.
Rikke
Rikke 05/24/2023 10:46 AM
Any news on this? If not then I have to look at the RTC save in memory method :๐Ÿ˜‰:
bitphlipphar
bitphlipphar 05/25/2023 09:45 AM
I'm struggling a little bit with getting the API in place. The challenge is that we'd like to support getting the signal quality when the modem is turned on, but before we've been able to connect. We don't really model that state yet, so I'm trying to find out how we want to do it (long term), so the API can work well in the future too.
Rikke
Rikke 05/25/2023 11:26 AM
Okay, we put modem on the side for now :๐Ÿ™‚: Our own module for modem connectivity is a bit delayed so we need to plan out our next step
bitphlipphar
bitphlipphar 05/25/2023 12:14 PM
I think I have a plan to move this forward, so we should have something ready for you within a week or two.
Rikke
Rikke 05/25/2023 01:55 PM
That would be cool :๐Ÿ˜„: should have the module ready by then
Rikke
Rikke 06/06/2023 12:29 PM
We run the monarch container as a spawn now, because this gives us the opportunity to use wifi or cellular. We were unable to open wifi before, because we use the generic net.open calls etc to match our preferred internet connection type. I haven't found any problems with spawning yet, but perhaps I will find some soon :๐Ÿ˜„: I hope the API work is going well, I know you guys have much on your plate right now
Rikke
Rikke 06/22/2023 10:28 AM
Any news?
bitphlipphar
bitphlipphar 06/24/2023 11:26 AM
@Rikke Still on my list, but now at the top. We will ship an updated SDK next week that has some solution to this problem.
bitphlipphar
bitphlipphar 06/26/2023 09:32 AM
GitHub is where people build software. More than 100 million people use GitHub to discover, fork, and contribute to over 330 million projects.
bitphlipphar
bitphlipphar 06/26/2023 09:33 AM
The first attempt requires you to import the cellular package and use it like this:
import cellular.signal main: quality := signal.quality print "power = $quality.power"
bitphlipphar
bitphlipphar 06/26/2023 11:55 AM
Rikke
Rikke 06/26/2023 03:33 PM
I will look at it tomorrow :๐Ÿ™‚:
24 messages in total