This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

NRF9160 Board for Qr Code Project

I need to create an IoT QR code reader.

I decide to use the NRF9160 board because it integrates a lot of components that I need to use (LTE, GPS, Bluetooth) so the only mandatory device to buy was the QR Code Reader.

This project aims to prepare a message to be sent to a blockchain, and this message is composed of the QrcodeData read, the location GPS, the time, etc.

It does not seem to be so difficult. -.-

I tried to connect the device with the NRF Cloud but the LTE connection is not available in Italy

I connected the four pins (VCC, GND, RX, TX of the reader to 5V, GND, 0.10, 0,11 of the board) of the Qr code reader (https://www.amazon.it/Waveshare-Barcode-Scanning-Directly-Computer/dp/B07P3GD3XV) to the board and I tried the UART connection with no results.

Then I tried the GPS connection following the sample of the guide with no results, always "Searching device".

I think that I really can't realize the project with this board, so I have three solutions, or I try to set a way to program the NRF9160 with the Arduino IDE where I feel more comfortable, or someone, probably God, helps me, or I change the board.

So, there is a way to program with the Arduino IDE?

This is all folks!

Merry Christmas and happy new year! :)

Parents
  • Okay now I solved a lot of issues:
    -the QR code reader is working
    -the GPS is working
    -I bought another sim that has nb-IoT coverage in my country.

    The next problems are:
    -I need to put in the same application 2 samples that I used (GPS and uart), there is a way?
    -Arm trust zone helps me to execute code in a secure environment. To do this I only need to switch the build from secure and no secure, right?
    -How I can build the samples one time in secure mode and one time in no secure mode? What should I change?
    -Is there a way to encrypt my data using the ECC (Elliptic-curve cryptography)?
    Thank you!!

Reply
  • Okay now I solved a lot of issues:
    -the QR code reader is working
    -the GPS is working
    -I bought another sim that has nb-IoT coverage in my country.

    The next problems are:
    -I need to put in the same application 2 samples that I used (GPS and uart), there is a way?
    -Arm trust zone helps me to execute code in a secure environment. To do this I only need to switch the build from secure and no secure, right?
    -How I can build the samples one time in secure mode and one time in no secure mode? What should I change?
    -Is there a way to encrypt my data using the ECC (Elliptic-curve cryptography)?
    Thank you!!

Children
  • Gioele said:
    Okay now I solved a lot of issues:

    That's great to hear!

    Gioele said:
    I need to put in the same application 2 samples that I used (GPS and uart), there is a way?

    We don't have any guides on how to merge two applications/samples in the nRF Connect SDK (NCS). However, the process is generally quite straight forward. But, at the same time, a lot of the details depends on how you want the merged application to work.

    But in general, in the new application, you will usually need the Kconfig options and devicetree changes from both the individual applications. The same goes for the CMakeLists.txt file. Then, you need to merge the code, in a manner appropriate for your use case.

    Gioele said:
    Arm trust zone helps me to execute code in a secure environment.

    Not quite. It lets you isolate your critical security software and private information from the rest of the application. It is the sepparation that is important, not what domain you are in.

    So benefiting from TrustZone is not as simple as flipping a switch, but requires more careful consideration of the design of your application.

    Currently, what we have of  "secure firmware" is the Secure Partition Manager (SPM) and secure_services.

    We have an old, but hopefully not completely outdated, blogpost describing how you can modify SPM to add more functionality: https://devzone.nordicsemi.com/guides/nrf-connect-sdk-guides/b/software/posts/using-a-custom-secure-partition-manager-wtih-your-application

    However, we are working on integrating Trusted Firmware-M (TF-M) into NCS. And if you plan on developing functionality which should run in the secure domain you should considering basing that work on TF-M rather than the SPM.

    Gioele said:
    Is there a way to encrypt my data using the ECC (Elliptic-curve cryptography)?

    What is the goal you want to achieve?

    If you want to encrypt the data while sending it to the server, using TLS should be sufficient, and you wouldn't need to encrypt the data yourself.

    If you need to encrypt the data yourself (rather than letting a protocol stack handle it), you should look at the Nordic Security Module.

  • Well, okay...
    I need to read a QR code (I do this with the uart) and for each QR code, I should associate the GPS information. So I should make these two applications work together in the same build.

    The problem is that the GPS works in the no-secure domain while uart works in the secure domain. I really don't know how to solve this problem.

    In each case, the aim of my project is to use the Arm trust zone technology and have at least the Qr code data isolated could be very cool.

    The goal that I want to achieve is that at the end I need to send this information encrypted to a server so maybe the ECC is not required. But about this how I can send all of this data to a specific server using the nb-IoT connection?

  • Gioele said:
    The problem is that the GPS works in the no-secure domain while uart works in the secure domain. I really don't know how to solve this problem.

    The GPS must be in the non-secure domain, because of limitation in the modem_lib. The UART can be in either domain, as long as the peripheral is configured to be in the same domain as the code. This configuration is done by the SPM or TF-M.

    Which UART are you using?

    Why do you want the QR code handling to be in the secure domain? What are you trying to protect, and against what?

    For now, it is probably easiest to have everything in the non-secure domain, until we have proper support for custom TF-M partitions in NCS.

    Gioele said:
    The goal that I want to achieve is that at the end I need to send this information encrypted to a server so maybe the ECC is not required. But about this how I can send all of this data to a specific server using the nb-IoT connection?

    What protocols are you planning to use to communicate with your server?

    The nRF9160 samples in NCS covers most of the supported protocols in NCS, and would be a good starting point to see how communication with a server can be done.

  • We are using UART1. Our component is a Qr Code scanner that is connected with two pins to the nrf9160DK (RX-->10; TX-->11). How can we change the configuration? When we are trying to work in the non-secure domain the application continues to restart like in a loop.

    Another problem is that when we receive data from the uart we are not able to put in a variable only the data read without the other character set by the buffer size. We haven't a clear view of the data received.

    We want to protect the information inside the QR Code. This information mustn't be read or changed by someone before they are sent to the server.

    We should use the IoT device to prepare an Ethereum transaction. We are following the documentation related to the WEB3 implementation in your IoT device that is https://platformio.org/lib/show/3895/web3-arduino/examples . but is related to Arduino.

  • Gioele said:
    We want to protect the information inside the QR Code. This information mustn't be read or changed by someone before they are sent to the server.

    Where does the QR code come from? Wouldn't someone else reading the QR code directly be a bigger threat than someone hacking your device, and reading the QR code that way?

    The data has to be transferred to the non-secure domain at some point, so that it can be given to the modem.

    Gioele said:
    We are using UART1. Our component is a Qr Code scanner that is connected with two pins to the nrf9160DK (RX-->10; TX-->11). How can we change the configuration? When we are trying to work in the non-secure domain the application continues to restart like in a loop.

    Are you using TF-M or the SPM in the secure domain?

    Do you have any logs showing what happens?

    Gioele said:
    Another problem is that when we receive data from the uart we are not able to put in a variable only the data read without the other character set by the buffer size. We haven't a clear view of the data received.

    How are you reading from the UART?

    How is the data from the QR scanner formatted?

Related