DecksLabs / every-culfw

6 stars 3 forks source link

Compiling on a rpi4 #1

Closed gd35 closed 1 year ago

gd35 commented 1 year ago

I just discovered this project and it is exactly what I was looking for. I bought the 2 pieces of hardware. However, I just tried to compile the source code using my rpi4 but got a problem:

Compiling C: nanoCUL.c avr-gcc: error: device-specs/specs-atmega4809: No such file or directory make: *** [makefile:322: nanoCUL.o] Error 1

With the Arduino IDE on a rpi, avr-gcc is 5.4.0, too old to recognize the arduino every. I did it on a Mac. The compilation ran fine this time but I was not able to upload the new firmware. I had the following report:

`Traceback (most recent call last): File "reset.py", line 5, in com=serial.Serial(sys.argv[1],1200,dsrdtr=True) AttributeError: module 'serial' has no attribute 'Serial'

avrdude: Version 6.3-20190619 Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/ Copyright (c) 2007-2014 Joerg Wunsch

     System wide configuration file is "avrdude.conf"
     User configuration file is "/Users/xxx/.avrduderc"
     User configuration file does not exist or is not a regular file, skipping

     Using Port                    : /dev/cu.usbmodem141101
     Using Programmer              : jtag2updi
     Overriding Baud Rate          : 115200
     avrdude: jtagmkII_getsync(): sign-on command: status -1
     avrdude: jtagmkII_getsync(): sign-on command: status -1
     avrdude: jtagmkII_getsync(): sign-on command: status -1
     avrdude: jtagmkII_getsync(): sign-on command: status -1
     avrdude: jtagmkII_getsync(): sign-on command: status -1

` Any idea to solve this issue ?

Thanks in advance

DecksLabs commented 1 year ago

Hi,

reset.py is missing pyserial module. You need to install it using pip (pip3 install pyserial) or use system package, on rpi with raspbian/ubuntu it should be something like sudo apt install python3-pyserial.

It was something I struggled with. To reset Nano Every and make it enter programming mode you need to connect to its serial with 1200 baud rate for few seconds.

By the way, I just today received a bit better CC1101 module, now I got way better reception :)

gd35 commented 1 year ago

I made a confusion between serial and pyserial... my mistake. I will correct that this evening. I hope that I bought the correct CC1101. I started to use a dvb USB device to get data from my water meter. It worked well except that I received the data from my neighbours' water meters and not mine (that is underground) ! I thus need a USB device with a better reception. I am eager to test yours ;-)

DecksLabs commented 1 year ago

I got the same issue, I got electricity meter in the basement and live two storeys above it. Still no reception.

I will update documentation in a while, for now: adapter u.fl - sma https://pl.aliexpress.com/item/1005001838374288.html?spm=a2g0o.order_list.0.0.70351c24f70I0E&gatewayAdapt=glo2pol RF module: https://pl.aliexpress.com/item/1005003262052074.html?spm=a2g0o.order_list.0.0.70351c24f70I0E&gatewayAdapt=glo2pol

Much better reception with this set.

I've also designed enclosure for this that can be 3d printed yesterday, needs a little bit of improvement, I'll share it once it's finished :)

gd35 commented 1 year ago

Thanks for the links. I also bought an external antenna. I just uploaded successfully the firmware in the Arduino. I have now some soldering to do before testing.

Thanks a lot for your help

DecksLabs commented 1 year ago

I'm very happy I could help. It also puts a smile on my face that someone found it useful :⁠-⁠)

gd35 commented 1 year ago

Well, first attempt and failure to receive the telegrams... Maybe not the right time to make soldering. I was anxious to do it because I did not do soldering for many years ;-) May be connections are not OK...

    rpi4:$ wmbusmeters auto:t1
    Started auto cul on /dev/ttyACM0 listening on t1
    No meters configured. Printing id:s of all telegrams heard!

but no telegrams received so far. But wmbusmeters found the device and it knows that is it a cul compatible device.

DecksLabs commented 1 year ago

Double check wiring, I just checked with my notes and the table posted in docs is fine. It also might be that the module you got from aliexpress is faulty :/

gd35 commented 1 year ago

I did a triple check ;-) I got it from amazon. I suspect my weak soldering skill ;-) I probably burnt a component by applying heat too much...

I have now the following info:

rpi4:~$ wmbusmeters --analyze auto:t1
Started auto cul on /dev/ttyACM0 listening on t1

I do not have anymore this message:

No meters configured. Printing id:s of all telegrams heard!

gd35 commented 1 year ago

Good news, it has worked... but the signal is very weak. I waited several minutes before receiving a telegram... I removed the meter id (this is not mine ;-)

Received telegram from: 01234567
          manufacturer: (SAP) Sappel (0x4c30)
                  type: Water meter (0x07)
                   ver: 0x00
                device: cul
                  rssi: -75 dBm
                driver: izar
(wmbus) 000   : 19 length (25 bytes)
(wmbus) 001   : 44 dll-c (from meter SND_NR)
(wmbus) 002   : 304c dll-mfct (SAP)
(wmbus) 004   : 76d01621 dll-id (2116d076)
(wmbus) 008   : 00 dll-version
(wmbus) 009   : 07 dll-type (Water meter)
(wmbus) 010   : a1 tpl-ci-field (Mfct specific)
(wmbus) 011 C?: 711500135417E655893552DECE501B mfct specific
(wmbus) telegram from 01234567 ignored by all configured meters!

Is there a way to program the CC1101 to increase the sensitivity of the receiver ?

I will order the same board that the one you mentioned in your previous post. It seems that is is much better in term of signal acquisition.

DecksLabs commented 1 year ago

great news. I don't know about any sensitivity settings, at least cul doesn't provide such option.

To increase sensitivity you need better antenna (the one that I linked in the docs isn't great but it's not terrible, it obviously doesn't have 12dBi but is reasonably tuned, checked on VNA at work). But the real difference was made by using this EBYTE module, it's night and day, though it require ufl-sma pigtail cable.

By the way, cul listen simultaneously for c1 and t1 mode telegrams.

gd35 commented 1 year ago

You convinced me to invest a bit more so I ordered yesterday the EBYTE module and the antenna you mentioned previously. But I have to wait one month to have it since the only way to get them is through Aliexpress. First time to me to use this web shop.

DecksLabs commented 1 year ago

Yeah, I order exotic stuff there and this module is quite exotic by local standards. I hope it will serve you well :) I need to update the docs so no one will buy those weak generic modules.

gd35 commented 1 year ago

I am also interested to know about the wiring of this new module with the Arduino Every. Will this require some modifications to the software ?

DecksLabs commented 1 year ago

No, no modifications to software required. Ebyte has pins labeled at the back of the module so you just need to wire the according to the table from documentation.

niedz., 11 wrz 2022, 15:53 użytkownik gd35 @.***> napisał:

I am also interested to know about the wiring of this new module with the Arduino Every. Will this require some modifications to the software ?

— Reply to this email directly, view it on GitHub https://github.com/DecksLabs/every-culfw/issues/1#issuecomment-1242970276, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABKVRDWYIZWJMOTXPHXOPVLV5XP5PANCNFSM6AAAAAAQBVF2WA . You are receiving this because you commented.Message ID: @.***>

gd35 commented 1 year ago

Fine ! Thanks

gd35 commented 1 year ago

I just received the ebyte module. It is very small. Do you have any advice concerning the soldering. Does it require a specific soldering tool ?

DecksLabs commented 1 year ago

Hi, No, I didn't use anything special. Just 30AWG wirewrap wire and fine tip soldering iron.

gd35 commented 1 year ago

I did the soldering yesterday. The ebyte module works fine but I did not receive data from my own meter. I got the data from the other meters but very few compared to the DVB USB device I used jointly with sdr and wmbusmeters.

Did you install a 100nF capacitor between the GND and 3.3V pins ? This is recommended in the ebyte user manual. I heard that adding this capacitor makes the reception much more stable.

Thanks again for your help

gd35 commented 1 year ago

A capacitor between the GND and 3.3V pins increased a lot the quality of the reception. So the issue is thus solved.

DecksLabs commented 1 year ago

Thanks for letting me know. I will incorporate this in the docs :) I also uploaded files for 3d printed case.