Date   

SODAQ One V3 porting

Léonard Bise <leodido99@...>
 

Hello guys,

I'm going to work on a project which is going to use the SODAQ One board (https://shop.sodaq.com/en/sodaq-one-eu-rn2483-v3.html).

It's a LoRa oriented development board which is designed around a ATSAMD21G18 (ARM Cortex M0+) microcontroller. In addition it has a uBlox EVA 8M GPS Module, LSM303AGR accelerometer and a LoRa + LoRaWAN RN2483A chip from Microchip.

The RN2483A LoRa chip uses a serial line, I won't be using a LoRaWAN stack, which I understand is not yet implemented in Zephyr anyway, so I guess there is no major issues there. The chip is commanded through simple commands.
The uBlox EVA 8M GPS module is connected to the I2C bus.
The LSM303AGR accelerometer is connected to the I2C bus.

In the supported hardware I see that the Adafruit Feather M0 Basic Prot is listed, which has this exact same microcontroller. I also read the Board Porting Guide and as I understand it basically I'd need to take the Adafruit configuration as a base and add these new components to the kconfiguration. All of the aspects related to the microcontroller are already there.

I was wondering how easy it would be to port Zephyr to the SODAQ One and if anyone has comments, advices and maybe point out if I'm missing something. 
In particular I'm also wondering how to handle the LoRa microchip, since Zephyr has no LoRaWAN stack what would be the best way to handle the porting of this part?

I'm really looking forward to work with Zephyr, which I have never used, but I have various experiences with other RTOSes.

Thank you,
Léonard.


Bluetooth Mesh - Restore the replay protection list

laczenJMS
 

Hi,

Bluetooth mesh has a replay protection list that basically keeps a
link between a address and a sequence counter to protect against
replay attacks. It checks if messages are ok by making checking if the
sequence counter is increasing. This only works if this sequence
counter is restored when the node is rebooted, for this it has to be
stored in flash.

As some nodes (frequent receiver nodes) get lots of messages this
could wear out flash rapidly. In order to avoid this rapid wear the
current persistent storage solution (which by the way is a great
addition) utilizes a timer to limit the amount of writes to flash.
This however creates a security risk just after power on if the write
to flash was not performed.

Maybe there is another way to make sure that the replay protection
list gets initialized correctly. Suppose that we would only store the
addresses we need to restore the replay protection list. After power
on we could restore the correct sequence number by exchanging a
message with the node (of which we have the address). But what message
?

As all nodes have mandatory configuration server and health server
models we can only use these. As the configuration messages use the
devkey this is not possible, so only the health messages are left. The
"health fault get message" seems to fit the requirement: it is an
acknowledged message so it will return an answer and it is mandatory
and therefore required by all nodes.

So the idea would be: to restore the replay protection list a node
incorporates the health client model. After reboot it sends "health
fault get message" to all nodes it has in its address list, a
successful receive of an acknowledge sets the correct sequence
counter. The flash wear is removed as the nodes only need to store the
addresses. Replay attacks are not possible because the response to the
"health fault get message" has increased the counter.

Would this be a good solution or do you see any security risks in this ?

Kind regards,

Jehudi


Re: echo_client and echo_server run in the same board

Jukka Rissanen
 

Hi Diana,

I just tried this and you can certainly enable client and server at the
same time. The compile error you are seeing is because you have
disabled TCP.

The https://github.com/zephyrproject-rtos/zephyr/pull/7653 will fix the
compile error.


Jukka

On Thu, 2018-05-17 at 07:44 -0700, Diana Rivera wrote:
Hello,

I am currently trying to run an nrf52 board as both client and server
at the same time (based on echo_client and echo_server samples). I've
gone through their configuration files, and have found that
CONFIG_NET_APP_CLIENT=y is enabled in the client, and
CONFIG_NET_APP_SERVER=y is enabled in the server. According to
Zephyr's documentation, this configurations need to be set to "y" to
enable the respective client and server's net app library APIs.
However, when enabling both CONFIG_NET_APP_SERVER=y and
CONFIG_NET_APP_CLIENT=y, the following errors appear:

In function ‘close_net_ctx’:
/home/user/zephyr/subsys/net/lib/app/client.c:279:19: error: ‘struct
<anonymous>’ has no member named ‘net_ctxs’
if (ctx->server.net_ctxs[i]) {
^
/home/user/zephyr/subsys/net/lib/app/client.c:280:32: error: ‘struct
<anonymous>’ has no member named ‘net_ctxs’
net_context_put(ctx->server.net_ctxs[i]);
^
/home/user/zephyr/subsys/net/lib/app/client.c:281:16: error: ‘struct
<anonymous>’ has no member named ‘net_ctxs’
ctx->server.net_ctxs[i] = NULL;

Is it impossible to run both client and server in the same board at
the same time? or is there a way to get around this problem?
I was thinking on running the client in a thread, and the server in
another thread, but that would still imply having both
CONFIG_NET_APP_SERVER=y and CONFIG_NET_APP_CLIENT=y enabled in the
prj.conf file.

Thank you in advance for your help.

Best regards,
Diana


Re: Multiple Instances of Drivers

Tomasz Bursztyka
 

Hi,

There is already an on-going work on how devices (aka driver instance)
are generated.

See issue:
https://github.com/zephyrproject-rtos/zephyr/issues/6293

Especially, check for b0661 and erwango PRs

Br,


Tomasz

I have a question about the current plan to allow multiple instances
of a driver.

For example, say we have two sx1509b devices as opposed to the
currently supported single instance:
&i2c0 {
status = "ok";
clock-frequency = <I2C_BITRATE_FAST>;

sx1509b: sx1509b@3e {
compatible = "semtech,sx1509b";
reg = <0x3e>;
label = "GPIO_P0";
};

sx1509b: sx1509b@3f {
compatible = "semtech,sx1509b";
reg = <0x3f>;
label = "GPIO_P1";
};
};

Only the one one whose .fixup defines CONFIG_GPIO_SX1509B_* gets an
instance, while the other doesn't. To add two devices, I would have
to
hack the driver + fixup to define the correct configuration
information.

I just want to know the current plan to address this and how drivers
need to be written going forward. I couldn't find an issue that
address this, but I could easily have missed it and am just "looking
in the other pocket for my keys".

- Pushpal



Multiple Instances of Drivers

Pushpal Sidhu
 

I have a question about the current plan to allow multiple instances
of a driver.

For example, say we have two sx1509b devices as opposed to the
currently supported single instance:
&i2c0 {
status = "ok";
clock-frequency = <I2C_BITRATE_FAST>;

sx1509b: sx1509b@3e {
compatible = "semtech,sx1509b";
reg = <0x3e>;
label = "GPIO_P0";
};

sx1509b: sx1509b@3f {
compatible = "semtech,sx1509b";
reg = <0x3f>;
label = "GPIO_P1";
};
};

Only the one one whose .fixup defines CONFIG_GPIO_SX1509B_* gets an
instance, while the other doesn't. To add two devices, I would have to
hack the driver + fixup to define the correct configuration
information.

I just want to know the current plan to address this and how drivers
need to be written going forward. I couldn't find an issue that
address this, but I could easily have missed it and am just "looking
in the other pocket for my keys".

- Pushpal


Storing data in flash at powerfail on nrf51/nrf52

laczenJMS
 

For bluetooth mesh it would be good to save the replay protection list
to a dedicated flash page. This save would only be done in the case of
a powerfail or a reboot.

nrf51/nrf52 have a powerfail warning but it is unclear to me how to
use it. I know that if the powerfail warning appears writes to flash
are disabled. So to make it work I would:

a. set the powerfail at a rather high voltage level -> how to do that ?
b. if the powerfail is triggered, disable it, clear it, set it at a
lower voltage level, and then do the writing to flash.

Are there any examples on how to use the powerfail mechanism on nrf51/nrf52 ?

Kind regards,

Jehudi


echo_client and echo_server run in the same board

Diana Rivera
 

Hello,

I am currently trying to run an nrf52 board as both client and server at the same time (based on echo_client and echo_server samples). I've gone through their configuration files, and have found that CONFIG_NET_APP_CLIENT=y is enabled in the client, and CONFIG_NET_APP_SERVER=y is enabled in the server. According to Zephyr's documentation, this configurations need to be set to "y" to enable the respective client and server's net app library APIs.
However, when enabling both CONFIG_NET_APP_SERVER=y and CONFIG_NET_APP_CLIENT=y, the following errors appear:

In function ‘close_net_ctx’:
/home/user/zephyr/subsys/net/lib/app/client.c:279:19: error: ‘struct <anonymous>’ has no member named ‘net_ctxs’
    if (ctx->server.net_ctxs[i]) {
                   ^
/home/user/zephyr/subsys/net/lib/app/client.c:280:32: error: ‘struct <anonymous>’ has no member named ‘net_ctxs’
     net_context_put(ctx->server.net_ctxs[i]);
                                ^
/home/user/zephyr/subsys/net/lib/app/client.c:281:16: error: ‘struct <anonymous>’ has no member named ‘net_ctxs’
     ctx->server.net_ctxs[i] = NULL;

Is it impossible to run both client and server in the same board at the same time? or is there a way to get around this problem?
I was thinking on running the client in a thread, and the server in another thread, but that would still imply having both CONFIG_NET_APP_SERVER=y and CONFIG_NET_APP_CLIENT=y enabled in the prj.conf file.

Thank you in advance for your help.

Best regards,
Diana 


Re: switching from #FCB to #NVS for #BluetoothMesh persistent storage #fcb #nvs #bluetoothmesh

Johan Hedberg
 

Hi Vikrant,

On Thu, May 17, 2018, vikrant8051 wrote:
Is #BluetoothMesh stack completely independent from persistence storage
mechanism used by #SettingLayer ?
Mesh will work with any settings backend (currently FCB and NFFS, and in
the future with NVS).

Johan


Re: switching from #FCB to #NVS for #BluetoothMesh persistent storage #fcb #nvs #bluetoothmesh

vikrant8051 <vikrant8051@...>
 

Hi Andrzej,

Is #BluetoothMesh stack completely independent from persistence storage mechanism used by #SettingLayer ?

If yes, then only it will possible.  😃

Thank You !!

On Thu, May 17, 2018 at 1:28 PM, Puzdrowski, Andrzej <Andrzej.Puzdrowski@...> wrote:

Hi.

 

I Think it will be possible – (but can’t be sure). At last Jehudi Maes (the NVS author) is considering right now ho to provide nvs-back-end for the setting (I’m in touch with him).

 

Andrzej

 

From: devel@... [mailto:devel@lists.zephyrproject.org] On Behalf Of vikrant8051
Sent: Wednesday, May 16, 2018 11:51 AM
To: devel@...; users@...
Subject: [Zephyr-devel] switching from #FCB to #NVS for #BluetoothMesh persistent storage

 

Hi,

 

will it be possible to choose between #FCB & #NVS for #BluetoothMesh persistence data storage using configuration options ?

 

Thank You !!

 

 

 

 

 



Re: switching from #FCB to #NVS for #BluetoothMesh persistent storage #fcb #nvs #bluetoothmesh

Puzdrowski, Andrzej
 

Hi.

 

I Think it will be possible – (but can’t be sure). At last Jehudi Maes (the NVS author) is considering right now ho to provide nvs-back-end for the setting (I’m in touch with him).

 

Andrzej

 

From: devel@... [mailto:devel@...] On Behalf Of vikrant8051
Sent: Wednesday, May 16, 2018 11:51 AM
To: devel@...; users@...
Subject: [Zephyr-devel] switching from #FCB to #NVS for #BluetoothMesh persistent storage

 

Hi,

 

will it be possible to choose between #FCB & #NVS for #BluetoothMesh persistence data storage using configuration options ?

 

Thank You !!

 

 

 

 

 


Re: LED API extension

Johannes Hutter
 

Hi Justin,

my proposal is:

typedef int (*led_api_brightness_fade(struct device *dev, u32_t led, u8_t start, u8_t stop, u32_t fade_time);

So it is similar to your approach, but the starting brightness would be part of it. With that additional parameter we don't have to track the current brightness to know whether to fade up or down for example.
I will post a PR today. Would be great, if you had a look at it. I doubt we will get it merged until friday, but it would be nice to work on it nonetheless.

Best Regards,
Joe


On Wed, May 16, 2018 at 8:36 PM Justin <jdemarti@...> wrote:

Hi Johannes,

I'd be interested in this as well.  I'm implementing something similar already using PWM API and a k_timer.  So I'm curious about what functionality you are proposing?
Would it be something like this
typedef int (*led_api_fade)(struct device *dev, u32_t led, u8_t value, u32_t msecs);
Where the led fades to value over msecs of time?

Thanks,
Justin


--

Johannes Hutter | Software Developer
Mail: johannes@... 


         Workaround GmbH (ProGlove)  
         Friedenstr. 4 | 81671 München

         Managing Director: Thomas Kirchner 
         HRB: 216605 | AG München 
         USt.-IdNr.: DE298859320



Re: Mailing list archives before 2017

Brett Preston
 

All - quick update in that we have identified what caused not all of the needed archives to be migrated over. Resolving this is both possible and should not take long. Task should be completed by EOD Thursday, May 17.

Thank you

On Wed, May 16, 2018 at 7:11 AM, Brett Preston <bpreston@...> wrote:
Thanks Carles. Checking with our IT team and will revert back once I have an update.

On Wed, May 16, 2018 at 7:10 AM, Cufi, Carles <Carles.Cufi@...> wrote:

+ Brett

 

From: devel@... <devel@...> On Behalf Of Erwan Gouriou
Sent: 16 May 2018 14:59
To: zephyr-devel <zephyr-devel@...ect.org>
Subject: [Zephyr-devel] Mailing list archives before 2017

 

Hi all,

 

I'm looking for mail archives of this mainling list before 2017.

Looking in https://lists.zephyrproject.org/g/devel, it only starts on Jan '17.

This might be because we changed mailinglist service recently.

 

Are there archives of archives?

 

Erwan

 

 




--
Brett Preston
The Linux Foundation
+1 (971) 303-9030
bpreston@...

Skype: bprestoncf



--
Brett Preston
The Linux Foundation
+1 (971) 303-9030
bpreston@...

Google Talk: bpreston@...
Skype: bprestoncf


Re: LED API extension

Justin
 

Hi Johannes,

I'd be interested in this as well.  I'm implementing something similar already using PWM API and a k_timer.  So I'm curious about what functionality you are proposing?
Would it be something like this
typedef int (*led_api_fade)(struct device *dev, u32_t led, u8_t value, u32_t msecs);
Where the led fades to value over msecs of time?

Thanks,
Justin



Re: Compiling mqtt_publisher example with ESP32

Leandro Pereira
 

Zach,

On 05/16/2018 10:32 AM, Zach wrote:
The example app implements TLS which is nice, but for Google IoT I need to be able to create JSON and JSON Web Tokens. Are there Zephyr libraries for either of these? Other than that I believe I just need to get the ESP32 connected to wifi, but I need to look into it more as that may be more of an espressif thing rather than a zephyr thing. Any help would be greatly appreciated!
WiFi on the ESP32 is not supported at the moment. Short answer: There are a few technical reasons for this, and making it work will require quite a bit of plumbing.

The long answer:

Zephyr is currently loaded by the first stage bootloader (in the ESP32 mask ROM) into RAM, and is executed from there. The instruction RAM (IRAM) is quite tiny, only a few kilobytes long.

The WiFi stack for ESP32 is immense in comparison. It's also only distributed as a binary object, and linked against Espressif's port of FreeRTOS, with the ABI defined by them, and requiring some features from that OS. Most of these things we can write shims for (e.g. synchronization primitives, memory allocation, this sort of thing), but Espressif is said to be working on an OS-agnostic version of their WiFi stack that would help in this scenario without any sort of hacks.

When you factor the IRAM size and the size of the WiFi stack, you'll end up finding that you need to enable a feature in the ESP32 SoC that's called "flash cache". The hardware will transparently fetch things from the flash memory into an IRAM chunk, execute it from there, and then you can have arbitrarily large code. Sort of, anyway... because this can get tricky with pages not being in the cache and interrupts happening... so we'll have to ensure that the whole Zephyr kernel is in IRAM (so that, for instance, interrupt handlers can use any of the Zephyr API without triggering an interrupt because parts of it aren't in the cached region yet; this can get tricky with our API, especially those with user-defined callbacks such as the GPIO API).

This also requires a second stage bootloader; in other words, ensuring that MCUBoot works on ESP32. It's not a difficult job, but it's one that has to be done to make all this work.

I've also stopped working on the ESP32 port due to many (unrelated) reasons, but I'll be glad to help with code and more details from my findings if anybody wants to take the torch, or coordinate with others that got my brain dump on the subject.

Cheers,
Leandro


Compiling mqtt_publisher example with ESP32

Zach
 

Hi All,

I'm trying to get a basic solution running, so if any of this is answered in the wiki I apologize. I'm looking to create an mqtt_client zephyr app running on an espressif ESP32. This is so that I can talk to Google IoT Core. I'm at the point where I have the mqtt_publisher example app compiling for the board, but now I'm running into more questions I was hoping I could get help with.

The example app implements TLS which is nice, but for Google IoT I need to be able to create JSON and JSON Web Tokens. Are there Zephyr libraries for either of these? Other than that I believe I just need to get the ESP32 connected to wifi, but I need to look into it more as that may be more of an espressif thing rather than a zephyr thing. Any help would be greatly appreciated!

Regards,
Zach Martin


Re: Mailing list archives before 2017

Brett Preston
 

Thanks Carles. Checking with our IT team and will revert back once I have an update.

On Wed, May 16, 2018 at 7:10 AM, Cufi, Carles <Carles.Cufi@...> wrote:

+ Brett

 

From: devel@... <devel@...> On Behalf Of Erwan Gouriou
Sent: 16 May 2018 14:59
To: zephyr-devel <zephyr-devel@lists.zephyrproject.org>
Subject: [Zephyr-devel] Mailing list archives before 2017

 

Hi all,

 

I'm looking for mail archives of this mainling list before 2017.

Looking in https://lists.zephyrproject.org/g/devel, it only starts on Jan '17.

This might be because we changed mailinglist service recently.

 

Are there archives of archives?

 

Erwan

 

 




--
Brett Preston
The Linux Foundation
+1 (971) 303-9030
bpreston@...

Google Talk: bpreston@...
Skype: bprestoncf


Re: Mailing list archives before 2017

Carles Cufi
 

+ Brett

 

From: devel@... <devel@...> On Behalf Of Erwan Gouriou
Sent: 16 May 2018 14:59
To: zephyr-devel <zephyr-devel@...>
Subject: [Zephyr-devel] Mailing list archives before 2017

 

Hi all,

 

I'm looking for mail archives of this mainling list before 2017.

Looking in https://lists.zephyrproject.org/g/devel, it only starts on Jan '17.

This might be because we changed mailinglist service recently.

 

Are there archives of archives?

 

Erwan

 

 


Mailing list archives before 2017

Erwan Gouriou
 

Hi all,

I'm looking for mail archives of this mainling list before 2017.
Looking in https://lists.zephyrproject.org/g/devel, it only starts on Jan '17.
This might be because we changed mailinglist service recently.

Are there archives of archives?

Erwan



switching from #FCB to #NVS for #BluetoothMesh persistent storage #fcb #nvs #bluetoothmesh

vikrant8051 <vikrant8051@...>
 

Hi,

will it be possible to choose between #FCB & #NVS for #BluetoothMesh persistence data storage using configuration options ?

Thank You !!






Doubt about good programming practice when setting https settings

christian tavares
 

Hello!! 

I have a doubt, I'm developing a library http_client with https. 

However I don't know if I should set the https config (HTTPS_STACK, K_THREAD_POOL..) on my library or I should define at app. 

What is the right way? Could someone help me? Thank you.  

3601 - 3620 of 8196