Date   

Re: micro:bit GPIO read always returning 1

Martin Woolley <mwoolley@...>
 

Hi Carles and thanks for the quick response 😊

 

micro:bit buttons, which are of course connected to GPIO pins work fine in interrupt mode:

 

#define PIN_A SW0_GPIO_PIN

#define PORT SW0_GPIO_NAME

#define EDGE (GPIO_INT_EDGE | GPIO_INT_ACTIVE_LOW | GPIO_INT_DEBOUNCE)

 

 

  gpiob = device_get_binding(PORT);

  if (!gpiob)

  {

    printk("error\n");

    return;

  }

 

  // Button A

  gpio_pin_configure(gpiob, PIN_A, GPIO_DIR_IN | GPIO_INT | EDGE);

  gpio_init_callback(&gpio_btnA_cb, button_A_pressed, BIT(PIN_A));

  gpio_add_callback(gpiob, &gpio_btnA_cb);

  gpio_pin_enable_callback(gpiob, PIN_A);

 

 

 

I haven’t tried interrupt mode with pins on the edge connector. I’ll try that next. Presumably the same pin configuration (apart from the pin number)  should be valid.

 

Do you see anything obviously wrong with the pin config I’m using for polling, though? I’ve tried various flags but none of them made any difference for me. This is doubtless user error.... but what that error is I don’t yet know.

 

I’ll try interrupt mode and report back.

 

Regards

 

Martin

 

 

From: Cufi, Carles [mailto:Carles.Cufi@...]
Sent: 21 February 2018 13:35
To: Martin Woolley <mwoolley@...>; zephyr-users@...
Subject: RE: micro:bit GPIO read always returning 1

 

Hi Martin,

 

I’ve only ever tested that GPIO driver in interrupt mode, but I don’t see why it shouldn’t work in polling mode.

Have you tried it in interrupt mode to see if it works?

 

Unfortunately our driver expert is away this week, I’m sure he’ll respond next week though.

 

Maybe Johan can give us some input as well.

 

Regards,

 

Carles

 

From: zephyr-users-bounces@... [mailto:zephyr-users-bounces@...] On Behalf Of Martin Woolley
Sent: 21 February 2018 14:08
To: zephyr-users@...
Subject: [Zephyr-users] micro:bit GPIO read always returning 1

 

Zephyr newbie question. I’m trying to poll an external pin on a micro:bit. I have a rocker switch with pull up resistor connected to it and the circuit works (tested with code written with microbit-dal APIs). My Zephyr GPIO reads always return 1, however. What am I doing wrong?

 

This video shows code which uses the microbit-dal APIs working... I want to achieve the same for Zephyr:

 

https://drive.google.com/open?id=1h3LWC_PPNBhBs2mAFJj0ZgRvkd9Dk1NB

 

Code fragments:

 

#define PIN_0 EXT_P0_GPIO_PIN

struct device *gpiob;

void poll(void)

{

     struct mb_display *disp = mb_display_get();

     while (1) {

       u32_t val = 0;

      gpio_pin_read(gpiob, PIN_0, &val);

       printk("%d\n",val);

     }

}

 

void main(void)

{

     gpiob = device_get_binding(GPIO_DRV_NAME);

     if (!gpiob)

     {

           printk("error\n");

           return;

     }

 

     // Pin 0 - simple input config - suitable for polling

     gpio_pin_configure(gpiob, PIN_0, GPIO_DIR_IN | GPIO_PUD_PULL_UP );

     printk("Sampling micro:bit pin P0\n");

     poll();

 

Thanks


Re: micro:bit GPIO read always returning 1

Carles Cufi
 

Hi Martin,

 

I’ve only ever tested that GPIO driver in interrupt mode, but I don’t see why it shouldn’t work in polling mode.

Have you tried it in interrupt mode to see if it works?

 

Unfortunately our driver expert is away this week, I’m sure he’ll respond next week though.

 

Maybe Johan can give us some input as well.

 

Regards,

 

Carles

 

From: zephyr-users-bounces@... [mailto:zephyr-users-bounces@...] On Behalf Of Martin Woolley
Sent: 21 February 2018 14:08
To: zephyr-users@...
Subject: [Zephyr-users] micro:bit GPIO read always returning 1

 

Zephyr newbie question. I’m trying to poll an external pin on a micro:bit. I have a rocker switch with pull up resistor connected to it and the circuit works (tested with code written with microbit-dal APIs). My Zephyr GPIO reads always return 1, however. What am I doing wrong?

 

This video shows code which uses the microbit-dal APIs working... I want to achieve the same for Zephyr:

 

https://drive.google.com/open?id=1h3LWC_PPNBhBs2mAFJj0ZgRvkd9Dk1NB

 

Code fragments:

 

#define PIN_0 EXT_P0_GPIO_PIN

struct device *gpiob;

void poll(void)

{

     struct mb_display *disp = mb_display_get();

     while (1) {

       u32_t val = 0;

      gpio_pin_read(gpiob, PIN_0, &val);

       printk("%d\n",val);

     }

}

 

void main(void)

{

     gpiob = device_get_binding(GPIO_DRV_NAME);

     if (!gpiob)

     {

           printk("error\n");

           return;

     }

 

     // Pin 0 - simple input config - suitable for polling

     gpio_pin_configure(gpiob, PIN_0, GPIO_DIR_IN | GPIO_PUD_PULL_UP );

     printk("Sampling micro:bit pin P0\n");

     poll();

 

Thanks


micro:bit GPIO read always returning 1

Martin Woolley <mwoolley@...>
 

Zephyr newbie question. I’m trying to poll an external pin on a micro:bit. I have a rocker switch with pull up resistor connected to it and the circuit works (tested with code written with microbit-dal APIs). My Zephyr GPIO reads always return 1, however. What am I doing wrong?

 

This video shows code which uses the microbit-dal APIs working... I want to achieve the same for Zephyr:

 

https://drive.google.com/open?id=1h3LWC_PPNBhBs2mAFJj0ZgRvkd9Dk1NB

 

Code fragments:

 

#define PIN_0 EXT_P0_GPIO_PIN

struct device *gpiob;

void poll(void)

{

     struct mb_display *disp = mb_display_get();

     while (1) {

       u32_t val = 0;

      gpio_pin_read(gpiob, PIN_0, &val);

       printk("%d\n",val);

     }

}

 

void main(void)

{

     gpiob = device_get_binding(GPIO_DRV_NAME);

     if (!gpiob)

     {

           printk("error\n");

           return;

     }

 

     // Pin 0 - simple input config - suitable for polling

     gpio_pin_configure(gpiob, PIN_0, GPIO_DIR_IN | GPIO_PUD_PULL_UP );

     printk("Sampling micro:bit pin P0\n");

     poll();

 

Thanks


zephyr dlist crash

Ryan Johnson <Ryan.Johnson@...>
 

Hello,

 

I’m seeing zephyr crash w/ an invalid dlist pointer while handling timers.

 

I’m running mcuboot based on zephyr, so this issue may be mcuboot specific, but I thought I’d ask if anyone has seen this crash before.

 

[MCUBOOT] [INF] main: Starting bootloader

 

[MCUBOOT] [INF] boot_status_source: Image 0: magic=good, copy_done=0x1, image_ok=0xff

<LF>[MCUBOOT] [INF] boot_status_source: Scratch: magic=bad, copy_done=0x10, image_ok=0x6b

<LF>[MCUBOOT] [INF] boot_status_source: Boot source: none

<LF>[MCUBOOT] [INF] boot_swap_type: Swap type: revert

 

***** BUS FAULT *****

<LF>  Executing thread ID (thread): 0x20001658

<LF>  Faulting instruction address:  0x8007704

<LF>  Precise data bus error

<LF>  Address: 0xfe2bf00c

 

C:\STM32Toolchain\eclipse\plugins\fr.ac6.mcu.externaltools.arm-none.win32_1.13.3.201707031232\tools\compiler\bin>arm-none-eabi-addr2line.exe -e C:\cygwin64\home\sdorjohn\ns\mcuboot\outdir\ns_common\zephyr.elf -a 0x8007704

 

0x08007704

C:/cygwin64/home/sdorjohn/ns/zephyr/include/misc/dlist.h:228

 

 

Thread #1 (Suspended : Signal : SIGINT:Interrupt)           

               k_cpu_idle() at cpu_idle.S:135 0x8006bf0           

               _SysFatalErrorHandler() at sys_fatal_error_handler.c:70 0x8006c8e       

               _Fault() at fault.c:365 0x8006b28            

               __usage_fault() at fault_s.S:108 0x8006c16        

               <signal handler called>() at 0xfffffff1     

               sys_dlist_is_empty() at dlist.h:228 0x8007704   

               sys_dlist_peek_head() at dlist.h:256 0x8007704               

               handle_timeouts() at sys_clock.c:252 0x8007704             

               _nano_sys_clock_tick_announce() at sys_clock.c:377 0x8007704             

               _timer_int_handler() at cortex_m_systick.c:348 0x800224a        

               <signal handler called>() at 0xfffffffd    

               0x6402 

               0xd00dbeee      

 


Ryan C Johnson
Principal Systems Architect, Intelligent Asset Tracking Business Unit

5950 Nancy Ridge Dr. Ste 500
San Diego, CA 92121 USA

mobile: +1 858 401 3406
email: ryan.johnson@...
web: flex.com

 


Legal Disclaimer:
The information contained in this message may be privileged and confidential. It is intended to be read only by the individual or entity to whom it is addressed or by their designee. If the reader of this message is not the intended recipient, you are on notice that any distribution of this message, in any form, is strictly prohibited. If you have received this message in error, please immediately notify the sender and delete or destroy any copy of this message!


Compiling GNU scientific library (gsl)

ashish.shukla@corvi.com <ashish.shukla@...>
 

Hi everyone,

I've to work with matrix operations in my zephyr project, for which I think GNU scientific library will suit best.

Can someone help me in compiling zephyr project codes with gsl?

--
Warm regards,
Ashish Shukla
Jr. Embedded Engineer
Research & Development


Please consider the environment before printing this e-mail or its attachments.

Disclaimer: The information contained herein (including any accompanying documents) is confidential and is intended solely for the addressee(s). If you have erroneously received this message, please immediately delete it and notify the sender. Also, if you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this message or any accompanying document is strictly prohibited and is unlawful. The organization is not responsible for any damage caused by a virus or alteration of the e-mail by a third party or otherwise. The contents of this message may not necessarily represent the views or policies of Corvi


Re: [Zephyr-devel] Concern about #BluetoothMesh Sequence number #bluetoothmesh

Vikrant More <vikrant8051@...>
 

Hi Johan, 

Thanks for clarification & providing other additional important details.

I think, Local sequence no. (for sender) & RPL (for receiver ) both are same for flash in terms of write cycle. Ultimately this gonna headache in #BluetoothMesh implementation. :)

Regards,
vikrant8051


On Feb 16, 2018 11:13 PM, "Johan Hedberg" <johan.hedberg@...> wrote:
Hi Vikrant,

On Fri, Feb 16, 2018, Vikrant More wrote:
> SoC like nRF52840 supports only 10k write cycles.
>
> Is that means, saving sequence no. as soon as NODE receives message,

Do you mean "sends" and not "receives"? The local sequence number is
updated whenever you send a message. It's the RPL that's updated when
you receive a message. Or are you talking about the RPL?

> on flash could corrupt it after 500 days if it receives 20 messages
> per day from same source address ?

That only holds true if you don't do any wear leveling. And even with
wear leveling it would be a quite suboptimal implementation of sequence
number persitency. A more optimal solution is to update the sequence
number in flash e.g. only for every 100th message, and then add 100 to
the stored value when you boot up. More advanced products might not
store the sequence number actively in flash at all, but instead have a
"backup" capacitor that has enough energy to write the current sequence
number to flash when the main power is lost.

If you were referring to the RPL rather than the local sequence number,
then similar approaches could be used for that as well.

Johan


Re: [Zephyr-devel] Concern about #BluetoothMesh Sequence number #bluetoothmesh

Johan Hedberg
 

Hi Vikrant,

On Fri, Feb 16, 2018, Vikrant More wrote:
SoC like nRF52840 supports only 10k write cycles.

Is that means, saving sequence no. as soon as NODE receives message,
Do you mean "sends" and not "receives"? The local sequence number is
updated whenever you send a message. It's the RPL that's updated when
you receive a message. Or are you talking about the RPL?

on flash could corrupt it after 500 days if it receives 20 messages
per day from same source address ?
That only holds true if you don't do any wear leveling. And even with
wear leveling it would be a quite suboptimal implementation of sequence
number persitency. A more optimal solution is to update the sequence
number in flash e.g. only for every 100th message, and then add 100 to
the stored value when you boot up. More advanced products might not
store the sequence number actively in flash at all, but instead have a
"backup" capacitor that has enough energy to write the current sequence
number to flash when the main power is lost.

If you were referring to the RPL rather than the local sequence number,
then similar approaches could be used for that as well.

Johan


Concern about #BluetoothMesh Sequence number #bluetoothmesh

Vikrant More <vikrant8051@...>
 

Hello to all,

SoC like nRF52840 supports only 10k write cycles.

Is that means, saving sequence no. as soon as NODE receives message, on flash could corrupt it after 500 days if it receives 20 messages per day from same source address ?

----------------------------------------------------------------------------

Suppose scenario, in which Node 'A' with Server Model switched OFF which is part of Group 'Hall', and Node with Client Model is still active and sending messages to other Nodes of Group 'Hall'. 

Meanwhile attacker, captured the frames.

So he could use those messages to trigger Node 'A' after it switched ON. Am I right ? 

----------------------------------------------------------------------------

Is there any other variable similar to sequence no. which updates continuously & that we have to save on SoC flash ?

Thank You !!


5.48 tar.gz package is missing the mesh JSON files

Martin Woolley <mwoolley@...>
 

It looks like the 5.48 tar.gz download file is missing the local_node.json  and prov_db.json files which meshctl looks for.


nRF Sniffer

Chettimada, Vinayak Kariappa
 

Hi,

This e-mail is only for information.
In a recent email chain, I had mentioned nRF Sniffer.
If you own a nRF51 dongle/DK or nRF52832 PCA10040 DK, you have a free simple Bluetooth Low Energy packet sniffer.


I had used older sniffer for nRF51 dongle on Windows OS with no issues before. 
Today I installed it on my Mac Book Pro macOS High Sierra for PCA10040 nRF52832 board without any issues, in very simple steps as described in the User Guide.

The sniffer works seamlessly when using Wireshark, my observations:
- The documented LED1 is off on PCA10040, LED2 keeps blinking when it is sniffer all advertising.
- LED2 is off, LED1 is blinking for every packet (Adv or Connected) sniffing/following a particular device when selected in Wireshark.

Regards,
Vinayak

- LED2 will blink a lot, will not be surprised, every place in the world with a smart phone around, more than 5 BLE devices advertising in a 10m diameter around you!  


Re: [Zephyr-devel] How to make Zephyr Based BLE device'd MAC address static ?

Vikrant More <vikrant8051@...>
 

Hi Johan,

Thanks for clarification.

But what to add or modify so that, we can avoid pairing of Device after every reset ?

How to take control of (6 digits ) pairing key, instead of generating random one ?

Regards,
vikrant8051


On Tue, Feb 13, 2018 at 10:43 PM, Johan Hedberg <johan.hedberg@...> wrote:
Hi Vikrant,

On Tue, Feb 13, 2018, Vikrant More wrote:
> Using available Zephyr Bluetooth APIs, I've develop BLE Device which is
> compatible with Nordic Blinky App. I'm doing testing on nrf52840-PDK board.
>
> But after every reset, it's MAC address gets changed with random one. How
> to make it static, so that no need of pairing with smartphone again & again
> ?
>
> How to take control of pairing key, instead of generating random one ?

All nRF boards *should* be using a static random identity address that's
read out from the FICR, i.e. you should then see the same address
printed out to the console every time Bluetooth initializes (assuming
you have a console, and CONFIG_BT_DEBUG_LOG=y). That said, if you have
CONFIG_BT_PRIVACY=y, then a Resolvable Private Address will be used, and
remote devices can only resolve this to the identity address after
pairing.

Johan


Re: [Zephyr-devel] How to make Zephyr Based BLE device'd MAC address static ?

Johan Hedberg
 

Hi Vikrant,

On Tue, Feb 13, 2018, Vikrant More wrote:
Using available Zephyr Bluetooth APIs, I've develop BLE Device which is
compatible with Nordic Blinky App. I'm doing testing on nrf52840-PDK board.

But after every reset, it's MAC address gets changed with random one. How
to make it static, so that no need of pairing with smartphone again & again
?

How to take control of pairing key, instead of generating random one ?
All nRF boards *should* be using a static random identity address that's
read out from the FICR, i.e. you should then see the same address
printed out to the console every time Bluetooth initializes (assuming
you have a console, and CONFIG_BT_DEBUG_LOG=y). That said, if you have
CONFIG_BT_PRIVACY=y, then a Resolvable Private Address will be used, and
remote devices can only resolve this to the identity address after
pairing.

Johan


Zephyr BLE Device pairing

Vikrant More <vikrant8051@...>
 

Hello, 


I wanna do pairing of my nrf52840-PDK based BLE device (with nRF Blinky Service) with smartphone using method describe in above video link. 

How to achieve it, so that as soon as PDK receive pairing request from smartphone onboard Led4 should turn ON and by just pressing Button4 it should paired with smartphone ?

Plus Device should go in pairing mode only after pressing Button3 on PDK board.

Is this possible, with available Zephyr Bluetooth APIs ?

In this method, is distance between Device & smartphone matter ?

Is it secure method ?

Thank You !!


How to make Zephyr Based BLE device'd MAC address static ?

Vikrant More <vikrant8051@...>
 

Hello,

Using available Zephyr Bluetooth APIs, I've develop BLE Device which is compatible with Nordic Blinky App. I'm doing testing on nrf52840-PDK board.

But after every reset, it's MAC address gets changed with random one. How to make it static, so that no need of pairing with smartphone again & again ?

How to take control of pairing key, instead of generating random one ?

Thank You !!


Installing matrix library in c in zephyr

ashish.shukla@corvi.com <ashish.shukla@...>
 

Hi everyone,

I've to work with matrix operations, It's difficult to write my own functions correctly.

Can someone suggest some workaround for the same?

Is it possible to compile python code along with c ?

--
Warm regards,
Ashish Shukla
Jr. Embedded Engineer
Research & Development


Please consider the environment before printing this e-mail or its attachments.

Disclaimer: The information contained herein (including any accompanying documents) is confidential and is intended solely for the addressee(s). If you have erroneously received this message, please immediately delete it and notify the sender. Also, if you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this message or any accompanying document is strictly prohibited and is unlawful. The organization is not responsible for any damage caused by a virus or alteration of the e-mail by a third party or otherwise. The contents of this message may not necessarily represent the views or policies of Corvi


Re: Securing BLE device Services & Characteristics from unauthorized user

Luiz Augusto von Dentz
 

Hi Vikrant,

On Mon, Feb 12, 2018 at 2:34 PM, Vikrant More <vikrant8051@gmail.com> wrote:
Hello World !!

Suppose there is BLE device with following custom characteristics -
1. main
2. enc_text
3. plain_text
4. aes_key

"enc_text" characteristic receives 16 bytes of encrypted string.

"plain_text" characteristic receives 16 bytes of plain string.

"aes_key" characteristic receives 16 bytes of AES key.

int bt_encrypt_le(constu8_t key[16], const8_t plaintext[16], u8_t
enc_data[16])

Using this function I'm planning to encrypting received plain string & gonna
compare its output with
received encrypted string.

If both matches, then only "main" characteristic accepts data from client.

But what type of AES encryption is used behind this bt_encrypt_le( ) ?

How to disconnect BLE connection from BLE Device side ?

I wanna show "aes_key" characteristic only after device is in factory-reset
mode.
Once it receive AES key from user, it should disappear. How to do that ?
You will have to add a service containing the characteristic which
probably comes from a different application than the 'normal' mode,
now regarding the AES key exchange I don't think that would be secure
enough so you might as well just add a characteristic that requires
encryption and then once the app attempts to write triggers pairing,
if that manages to create a valid key and write is complete, it can be
any value really since it will be protected by having to pair, then
you can restart on normal mode.


Thanks !!




_______________________________________________
Zephyr-users mailing list
Zephyr-users@lists.zephyrproject.org
https://lists.zephyrproject.org/mailman/listinfo/zephyr-users


--
Luiz Augusto von Dentz


Porting the kernel to happy gecko

Cosmin Mihai
 

In order to make the microkernel work on Happy Gecko do I have to replicate the zephyr/ext/hal/silabs/gecko/Device/SiliconLabs/EFM32WG folder to zephyr/ext/hal/silabs/gecko/Device/SiliconLabs/EFM32HG and configure every define in every .h file? It looks like a lot of configuration to do and it looks like It is hard to debug in case of a mistake.


[ #BluetoothMesh ] possible Bug .. without assigning subscription address to Model, it is reacting to subscription address assign to other Model #bluetoothmesh

Vikrant More <vikrant8051@...>
 

Hello World !!

This is observation based on following configuration done by #meshctl.
Two nRF52840-PDK boards has been used for it.

For Board 1. after provisioning, I used following commands to configure it
**************************************************************************************

appkey-add 1

bind 0 1 1000
bind 0 1 1001
bind 0 1 1002
bind 0 1 1003

sub-add 0100 c000 1000
pub-set 0100 c000 1 0 5 1001

sub-add 0100 c000 1002
pub-set 0100 c000 1 0 5 1003


For Board 2. after provisioning, I used following commands to configure it
**************************************************************************************

appkey-add 1

bind 0 1 1000
bind 0 1 1001
bind 0 1 1002
bind 0 1 1003

sub-add 0101 c000 1000
pub-set 0101 c000 1 0 5 1001

In case of Board 2, I didn't assign pub & sub addresses to Models 1002 & 1003

**************************************************************************************

Button 1 & 2 are related to GEN_ONOFF_CLIENT
Button 3 & 4 are related to GEN_LEVEL_CLIENT

As per my implementation,
1. if Button 1 is pressed, then LED1 on all Boards turns ON.

2. if Button 2 is pressed, then LED1 on all Boards turns OFF.

3.if Button 3 is pressed, then it publishes value for eg. 2000.
   On subscriber side, it checks that value (since it is less than 10000 it turns ON LED3 & turns OFF LED4 )

4. if Button 4 is pressed, then it publishes value for eg. 15000.
   On subscriber side, it checks that value (since it is greater than 10000 it turns OFF LED 3 & turns ON LED4)

******************************************************************************************

Ideally, as per #meshctl configuration,

if I pressed Button1 on any board, then LED1 on all boards should turn ON & if pressed
pressed Button2 then LED1 should OFF.

And if I pressed Button3 or Button4 on Board1, it should affect LED3&4 only on Board1(self).

And if I pressed Button3 or Button4 on Board2, it should not affect LEDs on any Board.

********************************************************************************************

But here, I found strange behavior in case of Board2. Here without assigning subscription
addresses to Model 1002, LED 3 & LED 4 on Board2 are reacting as soon as I pressed
Button 3&4 on Board 1.


Is it Bug ?

Thank You !!


[ #BluetoothMesh ] possible Bug .. without assigning subscription address to Model, it is reacting to subscription address assign to other Model #bluetoothmesh

Vikrant More <vikrant8051@...>
 

This is observation based on following configuration done by #meshctl.
Two nRF52840-PDK boards has been used for it.

For Board 1. after provisioning, I used following commands to configure it
**************************************************************************************

appkey-add 1

bind 0 1 1000
bind 0 1 1001
bind 0 1 1002
bind 0 1 1003

sub-add 0100 c000 1000
pub-set 0100 c000 1 0 5 1001

sub-add 0100 c000 1002
pub-set 0100 c000 1 0 5 1003


For Board 2. after provisioning, I used following commands to configure it
**************************************************************************************

appkey-add 1

bind 0 1 1000
bind 0 1 1001
bind 0 1 1002
bind 0 1 1003

sub-add 0100 c000 1000
pub-set 0100 c000 1 0 5 1001

In case of Board 2, I didn't assign pub & sub addresses to Models 1002 & 1003

**************************************************************************************

Button 1 & 2 are related to GEN_ONOFF_CLIENT
Button 3 & 4 are related to GEN_LEVEL_CLIENT

As per my coding,
1. if Button 1 is pressed, then LED1 on all Boards turns ON.

2. if Button 2 is pressed, then LED1 on all Boards turns OFF.

3.if Button 3 is pressed, then it publishes value for eg. 2000.
   On subscriber side, it checks that value (since it is less than 10000 it turns ON LED3 & turns OFF LED4 )

4. if Button 4 is pressed, then it publishes value for eg. 15000.
   On subscriber side, it checks that value (since it is greater than 10000 it turns OFF LED 3 & turns ON LED4)

******************************************************************************************

Ideally, as per #meshctl configuration,

if I pressed Button1 on any board, then LED1 on all boards should turn ON & if pressed
pressed Button2 then LED1 should OFF.

And if I pressed Button3 or Button4 on Board1, it should affect LED3&4 on only self Board.

And if I pressed Button3 or Button4 on Board2, it should not affect LEDs on any Board.

********************************************************************************************

But here, I found strange behavior in case of Board2. Here without assigning subscription
addresses to Model 1002, LED 3 & LED 4 on Board 2 are reacting as soon as I pressed
Button 3&4 on Board 1. 

 


Securing BLE device Services & Characteristics from unauthorized user

Vikrant More <vikrant8051@...>
 

Hello World !!

Suppose there is BLE device with following custom characteristics -
1. main
2. enc_text
3. plain_text
4. aes_key

"enc_text" characteristic receives 16 bytes of encrypted string.

"plain_text" characteristic receives 16 bytes of plain string.

"aes_key" characteristic receives 16 bytes of AES key.

int bt_encrypt_le(constu8_t key[16], const8_t plaintext[16], u8_t enc_data[16])

Using this function I'm planning to encrypting received plain string & gonna compare its output with
received encrypted string.

If both matches, then only "main" characteristic accepts data from client.

But what type of AES encryption is used behind this bt_encrypt_le( ) ?

How to disconnect BLE connection from BLE Device side ?

I wanna show "aes_key" characteristic only after device is in factory-reset mode.
Once it receive AES key from user, it should disappear. How to do that ?


Thanks !!



2241 - 2260 of 2802