simple coap client-server communication of two posix applications
#coap
Stefan Hristozov
Hi,
I want to set up a simple setup of two posix projects -- one running a simple coap server and other running a simple coap client. What I did so far: 1) I build both /zephyrproject/zephyr/samples/net/sockets/coap_client and zephyrproject/zephyr/samples/net/sockets/coap_server without any changes. 2) I executed ./net-setup.sh. With sudo ifconfig I can see the new zeth interface: zeth: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500 inet 192.0.2.2 netmask 255.255.255.0 broadcast 0.0.0.0 inet6 2001:db8::2 prefixlen 128 scopeid 0x0<global> ether 00:00:5e:00:53:ff txqueuelen 1000 (Ethernet) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 3) I started the coap server posix program and tested it by sending a get request to the core1 resource (I used the coap-cli tool https://www.npmjs.com/package/coap-cli): coap get coap://[2001:db8::1]/core1 to which the server replied with: (2.05) Just a test So the server works as expected. In addition I used wireshark sniffing on the zeth interface --> The CoAP get request and the response was there. 4)I started the client -- on the consol I see: ***** Booting Zephyr OS build v2.0.0-rc2 ***** CoAP client GET but I cannot see any packets send in wireshark. I think something is not properly configured probably the zeth interface? How to test the coap_client sample when running it as a posix application? Best regards, Stefan
|
|
Enable traces on Serial Wire Output
#debugging
Hi,
I am just getting started with Zephyr and currently working on a STM32F746ZE. I added a custom configuration for this board based on STM32F746G_DISCO.
After having run successfully the blinky example, I am now trying to have traces on SWO (not UART), so that ultimately I have added in my Kconfig.defconfig:
Following the documentation, I added in the blinky main.c:
I build and flash it flawlessly but I got no output on my console (using JLINK to connect and I guess I am missing a flag/define/config somewhere (I get a little confused about where to define things in
|
|
API meeting: cancelled today
Carles Cufi
Hi all,
Due to several contributors being unavailable today and myself having an additional commitment I have decided to cancel this week's API meeting. Next week the meeting will take place as usual. Thanks, Carles
|
|
Serial communication Node-red
#ble
#bluetoothmesh
#gpio
#usb
#bluetooth
Daniel Fox <danny.fox97@...>
Hi,
I am wondering if anyone has tried reading for a serial port using node-red Currently, I'm using putty to read messages sent from my device built with help from zephyr mesh demo, as I'm using the bbc microbits with the nrf51's. Putty prints out a message e.g "button pressed" I was wondering if it can be done using node-red, it can read my usb port but it won't receive any messages. I'm not sure if it's compatible or not using c++. I'm wondering if anyone has been able to do something similar to this using the zephyr project. I need this because I am using home assistant to monitor various parts of my house, I want to read serial port on my raspberry pi (microbit connected to raspberry pi) which is running home assistant and output the message to the main user page (like how putty does with the terminal). Any help would be great thanks! Thanks for your time, Danny.
|
|
API meeting: agenda
Carles Cufi
Hi all,
The topics for today: - Discussion on whether to move the hw_info API to stable - PR: generalize async notification and add queued operation manager - https://github.com/zephyrproject-rtos/zephyr/pull/22853 - Defining the expected behavior of API calls in different contexts: settle on documentation guidelines - https://github.com/zephyrproject-rtos/zephyr/issues/18970 Additional items in the "Triage" column in the GitHub project may be discussed if time permits. If you want an item included in the meeting, please add it to the GitHub project. https://github.com/zephyrproject-rtos/zephyr/wiki/Zephyr-Committee-and-Working-Group-Meetings#zephyr-api-discussion https://github.com/zephyrproject-rtos/zephyr/projects/18 https://docs.google.com/document/d/1lv-8B5QE2m4FjBcvfqAXFIgQfW5oz6306zJ7GIZIWCk/edit Regards, Carles
|
|
Carles Cufi
Hi there,
Most of the questions you ask are covered in the DT documentation: https://docs.zephyrproject.org/latest/guides/dts/index.html#
The macros are generated by a Python script at build time, see the link above for details.
Regards,
Carles
From: users@... <users@...>
On Behalf Of henrique.guimaraes via Lists.Zephyrproject.Org
Sent: 18 February 2020 15:08 To: users@... Cc: users@... Subject: [Zephyr-users] Help on Devicetree aliases on eclipse #dts #eclipse #nrf52840
Good morning!
|
|
henrique.guimaraes@...
Good morning!
I'm a total newbie to Zephyr, learning the basics to implement in a project for an IoT sensor, more specifically IIoT(Industrial IoT). The module I'm using is a NINAB302, which incorporates a NRF52840. I know that Nordic Semi supports the project and that the microcontroller that I'm using is capable of running it. The IDE I'm using is Eclipse with the Zephyr pĺugin for it. My question is about the Devicetree aliases defines in the C/C++ code for example those in the Blinky example: "DT_ALIAS_LED0_GPIOS_PIN" . In my that code, eclipse isn't able to find the source of the aliases and freaks out putting red errors all over the place. But when I build the project, none of the errors matter, it builds perfectly and I can even flash the code to the device flawlessly. That's nice and all, but I feel like those defines could be very helpful if I knew where they were and how to use them. So, how the devicetree aliases defines works? Where are they found? And how can one create their personal defines?
|
|
Re: BBC-Microbit BLE MESH sending data
#ble
#bluetoothmesh
#gpio
#bluetooth
#nrf51822
Danny,
I find the best place to start is the samples, you should find examples of unsolicited messages in the mesh samples. You may also find that the Micro:bit is notoriously difficult to work with due to the memory size. I currently have 3 working as BLE Mesh nodes but I had to reconfigure the memory allocation "a lot" and am using 99.45%. Good luck Billy..
|
|
SDK 0.11.2 Release
Kumar Gala
Hi,
Some fixes based on usage of SDK v0.11.x and addition of some new xtensa variants to enable work from the Sound Open Firmware Project (https://www.sofproject.org). The SDK can be found here: https://github.com/zephyrproject-rtos/sdk-ng/releases/tag/v0.11.2 Please download and try things out and report any issues. • Fixed issue with setjmp/longjmp not existing on x86 32-bit build • Fixed python support on GDB: NOTE: Since python support is enabled in GDB the host system needs python3.6 installed. Otherwise you might get an error like: arm-zephyr-eabi-gdb: error while loading shared libraries: libpython3.6m.so.1.0: cannot open shared object file: No such file or directory On newer fedora systems this can show up and be fixed by: sudo dnf install python36 • Added support for Intel BDW and BDW Audio DSP xtensa toolchains. • Added support for NXP IMX8 and IMX8M Audio DSP xtensa toolchains. • Updated xtensa targets to GDB 8.3.1 (except S1000) Thanks to all that contributed fixes and enhancements to this version of the SDK. - k
|
|
Re: [Zephyr-devel] The topic-gpio branch has been merged to master
Piotr Mienkowski <piotr.mienkowski@...>
Hi all,
I would like to provide a bit more information about the recent change to the GPIO API. The main drive behind the rework was to support GPIO DTS bindings https://github.com/torvalds/linux/blob/master/include/dt-bindings/gpio/gpio.h as known from Linux DTS. That meant introduction of new flags: - GPIO_ACTIVE_HIGH, GPIO_ACTIVE_LOW - GPIO_OPEN_DRAIN, GPIO_OPEN_SOURCE - GPIO_PULL_UP, GPIO_PULL_DOWN All of the above flags are meant to be located in the DTS, typically at the board level. This allows to decouple application / driver code from the properties of the hardware they happen to work with. As an example, if gpio pin is connected to a button it could be described in the board DTS file as follows: button0: button_0 { gpios = <&gpio0 17 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; label = "Push button 0"; }; It means that the GPIO driver will need to enable a pull up on a pin and that the pin is active low. All this is transparent to the application which simply needs to pull in the DTS flags when configuring the pin. To access the flags generated from the DTS at the application level it is best to use the so called DT_ALIAS defines. The special DTS aliases node aliases { sw0 = &button0; }; is a convenient way to give generic application level names to specific DTS nodes. The resulting call in the application code could look like this gpio_pin_configure(dev_button, DT_ALIAS_SW0_GPIOS_PIN, DT_ALIAS_SW0_GPIOS_FLAGS | GPIO_INPUT); To access the flags at the driver level we should ideally be using the so called DT_INST defines. But here the situation is a little bit more complicated. The two new flags that had the biggest impact on the shape of the new GPIO API are GPIO_ACTIVE_HIGH and GPIO_ACTIVE_LOW. They define pin active level known in the new API as logical pin level. From the documentation "If pin is configured as Active High, a low physical level will be interpreted as logical value 0. If pin is configured as Active Low, a low physical level will be interpreted as logical value 1." At the application level the two flags encode cause -> effect relationship. In the above example of a button the GPIO_ACTIVE_LOW flag means that regardless of the specific design of the hardware button and the circuitry surrounding it if the button is pressed the pin will see low physical value. This relationship should be defined in DTS bindings. This level of abstraction is useful not only when building a generic application that reacts to the press of a button or has to turn on an LED but also when building a driver for a well documented external hardware module. Such module, e.g. a sensor connected over I2C bus, can provide an active high interrupt pin that should be routed to a GPIO pin on a SoC. A driver for the hardware module which is using pin logical rather than pin physical level allows for the possibility that the interrupt signal from the hardware module is routed to the GPIO pin via an inverter, e.g. because external module is in a different power domain. Once again the active level of the interrupt pin will be defined in DTS and allows the driver code to be decoupled from the specifics of the PCB design. An application can get / set pin logical level by calling gpio_pin_get, gpio_pin_set functions. It is still possible to access pin physical level, if required, by calling gpio_pin_get_raw, gpio_pin_set_raw functions. All these concepts are not entirely new. The old GPIO API provided flags such as GPIO_INT_ACTIVE_LOW and GPIO_POL_INV which aimed to achieve similar goal. However, they were not very well documented and not consistently implemented. Other modifications to the GPIO API include: - Interrupt configuration was moved to the dedicated gpio_pin_interrupt_configure() function. Configuring interrupts via gpio_pin_configure() is still supported but this feature will be removed in future releases. - New set of flags allows to define arbitrary interrupt configuration (if supported by the driver) based on pin physical or logical levels. The include/drivers/gpio.h contains in fact two sets of interrupt related flags, one targeted at the driver developers and the other at the users of the API. Only the latter is documented at https://docs.zephyrproject.org/latest/reference/peripherals/gpio.html and should be used by the applications. - New set of port functions that operate simultaneously on multiple pins that belong to the same controller. - New set of flags to configure pin as input, output or in/out as well as set output initial state. Majority of the old GPIO API has been deprecated and, to limit impact on the code size, re-implemented in terms of the new API. While the care was taken to preserve backward compatibility due to the scope of the work it was not possible to fully achieve this goal. We recommend to switch to the new GPIO API as soon as possible. Areas where the deprecated API may behave differently to the original old implementation are: - Configuration of pin interrupts, especially involving GPIO_INT_ACTIVE_LOW and GPIO_POL_INV flags. - Behavior of gpio_pin_configure() when invoked without interrupt related flags. In the new implementation of this deprecated functionality the interrupts remain unmodified. In the original implementation some of the GPIO drivers would disable the interrupts. Regards, Piotr
|
|
API meeting: agenda
Carles Cufi
Hi all,
The topics for today: - New API: DAC - https://github.com/zephyrproject-rtos/zephyr/pull/21805 - Overall post-GPIO triage and decision on what to tackle next Additional items in the "Triage" column in the GitHub project may be discussed if time permits. If you want an item included in the meeting, please add it to the GitHub project. https://github.com/zephyrproject-rtos/zephyr/wiki/Zephyr-Committee-and-Working-Group-Meetings#zephyr-api-discussion https://github.com/zephyrproject-rtos/zephyr/projects/18 https://docs.google.com/document/d/1lv-8B5QE2m4FjBcvfqAXFIgQfW5oz6306zJ7GIZIWCk/edit Regards, Carles
|
|
BBC-Microbit BLE MESH sending data
#ble
#bluetoothmesh
#gpio
#bluetooth
#nrf51822
Daniel Fox <danny.fox97@...>
Hi,
I am currently doing an engineering project for my final year, I have been using the bluetooth mesh demo on the zephyr project using the bbc microbits, I have set up a pir sensor up to produce a simple print statement("warning motion detected") to a serial communication terminal (Putty). Set up as follows: - BBC microbit hooked up to motion sensor -BBC microbits acting as beacons to send data to final device -Final bbc microbit connected to computer with putty running I want to send temperature readings to display onto a serial communication terminal. I am not sure how to send the readings over the mesh network as all i have really done is placed a print statement in the code. I'm wondering how do I send sensor readings over the ble mesh network using bbc microbits?(from my understanding I may need to send data packets but I'm unsure on how I would begin to code this). Any help would be appreciated, thanks for your time! Regards, Danny
|
|
Re: Private: Re: [Zephyr-users] bt_set_name() and setting local name
#ble
#bt
#bluetooth
#api
Carles Cufi
Hi there,
The name is placed in the advertising data automatically when you call bt_le_adv_start(BT_LE_ADV_CONN_NAME). When you call bt_set_name(), that is updated as well: https://github.com/zephyrproject-rtos/zephyr/blob/master/subsys/bluetooth/host/hci_core.c#L5444
That said, the name is placed in the scan response, so you need to make sure the scanner is performing active scanning.
Regards,
Carles
From: j.cheng via Lists.Zephyrproject.Org <j.cheng=de-haardt.com@...>
Sent: 10 February 2020 10:56 To: Cufi; Cufi, Carles <Carles.Cufi@...> Subject: Private: Re: [Zephyr-users] bt_set_name() and setting local name #ble #bt #bluetooth #api
Hi,
|
|
Re: bt_set_name() and setting local name
#bt
#bluetooth
#api
#ble
Carles Cufi
Hi there,
Most smartphones implement some sort of advertising data caching. Try stopping and starting scanning from the phone a couple of times to see if the name is updated without the need to connect.
Regards,
Carles
From: users@... <users@...>
On Behalf Of j.cheng via Lists.Zephyrproject.Org
Sent: 10 February 2020 10:06 To: users@... Cc: users@... Subject: [Zephyr-users] bt_set_name() and setting local name #ble #bt #bluetooth #api
Hello,
|
|
bt_set_name() and setting local name
#bt
#bluetooth
#api
#ble
j.cheng@...
Hello,
I want to change the ble device name during runtime. I've enabled BT_DEVICE_NAME_DYNAMIC and BT_SETTINGS. To change the device name during runtime i'm using bt_set_name(). However, when scanning for the device using the nrf connect toolbox app on my android device, i still see ''Zephyr'' as the device name. Only after connecting with the device, i see the correct new device name that was set by bt_set_name(). The bt_set_name() works, but not the way i would like to. Is there a way to show the changed device name before connecting with the device? Kind regards, Jamie
|
|
Re: Devicetree config generation
Carles Cufi
Hi Petr,
Yes, this has been talked about repeatedly over the last couple of years. You can find most of the issues and PRs related to the work that has been done so far in this umbrella issue: https://github.com/zephyrproject-rtos/zephyr/issues/8499
In the dev-review meeting on Thursdays we are currently discussing DeviceTree-related topics, and code generation, and in particular to solve the pinctrl/pinmux problem but also for instancing, is one of those topics. Kumar Gala (on copy) drives the overall DT efforts within Zephyr. Feel free to join the meeting or comment on the multiple issues or Pull Requests on GitHub to drive the feature forward.
Regards,
Carles
From:
<users@...> on behalf of "Petr Buchta via Lists.Zephyrproject.Org" <cz7asm=googlemail.com@...>
Hi, I just started looking around Zephyr and coming from Linux world I really like the idea of using Devicetree for driver configuration.
I noticed, however, that config generation that enables particular low level driver must be dobe manualy using Kconfig. I know that this is the same in Linux but given the way Zephyr leverages DT I would think that, in this case, config generation based on DT could simplify things.
For example looking at led_strip driver code samples, there are projects that duplicate almost all code only to bind to a different low level driver, like samples/drivers/apa102 and samples/drivers/ws2812. They even have the same prj.conf. If the DT processing could provide things like mapping "enabled device compatible string" -> "LL driver CONFIG_xx parameter", then there would be no need for code duplication and all the samples utilizing same driver api could share same project.
Is this something that's been considered but abandoned for a reason?
Thanks, Petr
|
|
Devicetree config generation
Petr Buchta <cz7asm@...>
Hi, I just started looking around Zephyr and coming from Linux world I really like the idea of using Devicetree for driver configuration. I noticed, however, that config generation that enables particular low level driver must be dobe manualy using Kconfig. I know that this is the same in Linux but given the way Zephyr leverages DT I would think that, in this case, config generation based on DT could simplify things. For example looking at led_strip driver code samples, there are projects that duplicate almost all code only to bind to a different low level driver, like samples/drivers/apa102 and samples/drivers/ws2812. They even have the same prj.conf. If the DT processing could provide things like mapping "enabled device compatible string" -> "LL driver CONFIG_xx parameter", then there would be no need for code duplication and all the samples utilizing same driver api could share same project. Is this something that's been considered but abandoned for a reason? Thanks, Petr
|
|
West 0.7.0 released, requires manual intervention on Ubuntu
Bolivar, Marti
Hello,
West 0.7.0 has been released. The main new feature since 0.6.x is the addition of "manifest imports", which let you pull in west.yml files from elsewhere into your own manifest file. You can upgrade in the usual ways: pip3 install west==0.7.0 # Windows and macOS pip3 install --user west==0.7.0 # Linux Please note that there is a problem with the upgrade on the version of pip3 which ships with Ubuntu 18.04. Other Linux distributions, macOS, and Windows are all upgrading successfully. On Ubuntu only, you will need to choose from one of the following workarounds to upgrade west: 1. Remove the old west before upgrading, like this: $ pip3 show west | grep Location: | cut -f 2 -d ' ' /home/foo/.local/lib/python3.6/site-packages $ rm -r /home/foo/.local/lib/python3.6/site-packages/west $ pip3 install --user west==0.7.0 2. Install west in a virtual environment using a more recent version of pip3, e.g. using the venv module: https://docs.python.org/3/library/venv.html Further details in this issue: https://github.com/zephyrproject-rtos/west/issues/373 And in particular, this comment: https://github.com/zephyrproject-rtos/west/issues/373#issuecomment-583489272 Thanks, Marti
|
|
The topic-gpio branch has been merged to master
Carles Cufi
Hi all,
As of this morning the 313 commits in the topic-gpio branch have been merged into Zephyr's master branch. What this means for you if: a) You are a GPIO API user: - Big chunks of the existing API have been deprecated, leading to deprecation build warnings. You should port your application to the new GPIO API as soon as possible, although you have 2 full Zephyr releases until the deprecated API is finally removed. Please refer to Peter Bigot's "porting guide" in this GitHub comment for additional information: https://github.com/zephyrproject-rtos/zephyr/issues/20017#issuecomment-549315497 b) You have outstanding, unmerged Pull Requests: - The Pull Requests may show green CI, but that is misleading. We encourage you to rebase your Pull Request as soon as possible against the current master and push. - If your Pull Request makes use of the GPIO API, it will not pass CI due to deprecation warnings. There is no solution but to port your code to the new GPIO API. If you are on a deadline for 2.2 feature freeze ping us on the #gpio channel on Slack to see if we can help. c) You are a maintainer with merge rights: - You need to make sure that CI has been rerun after the topic-gpio merge happened and *before* you merge any Pull Request to master Additional information about the merge process can be found here: https://github.com/zephyrproject-rtos/zephyr/issues/21789 Finally I want to thank everybody who contributed to this effort, which has spanned many months and several hundred commits. Special mention to Piotr Mienkowski and Peter Bigot, whose dedication to getting this done has made it possible to merge this branch in time for the 2.2 release. Regards, Carles
|
|
API meeting: Agenda
Carles Cufi
Hi all,
Today we will talk first about GPIO and the merge of the topic-gpio branch to master: - Cleanup the public and private API with typedefs - Testing status - Issues with master CI that might prevent the merge to master - https://github.com/zephyrproject-rtos/zephyr/issues/21789 Additionally I'd like to discuss: - RFC: API Change: clock_control - https://github.com/zephyrproject-rtos/zephyr/issues/22424 - Ability to use an API with device without extending its own API - https://github.com/zephyrproject-rtos/zephyr/issues/22415 Additional items in the "Triage" column in the GitHub project may be discussed if time permits. If you want an item included in the meeting, please add it to the GitHub project. https://github.com/zephyrproject-rtos/zephyr/wiki/Zephyr-Committee-and-Working-Group-Meetings#zephyr-api-discussion https://github.com/zephyrproject-rtos/zephyr/projects/18 https://docs.google.com/document/d/1lv-8B5QE2m4FjBcvfqAXFIgQfW5oz6306zJ7GIZIWCk/edit Regards, Carles
|
|