Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Writing codeplug to Anytone AT-D878UVII Plus resets APRS frequencies on device. #349

Closed
toco opened this issue Jun 19, 2023 · 24 comments · Fixed by #363
Closed

Writing codeplug to Anytone AT-D878UVII Plus resets APRS frequencies on device. #349

toco opened this issue Jun 19, 2023 · 24 comments · Fixed by #363
Assignees
Labels
AT-D578UV Affects Anytone AT-D578UV devices AT-D868UV Affects Anytone AT-D868UV devices AT-D878UV Affects Anytone AT-D878UV devices AT-D878UVII Affects AnyTone AT-D878UV II devices bug Something isn't working DMR-6X2UV Affects BETCH DMR-6X2UV devices

Comments

@toco
Copy link

toco commented Jun 19, 2023

When uploading a code-plug to my Anytone AT-D878UVII Plus the APRS frequencies stored on the device get reset.

Reproduced with qdmr at a335412 and Anytone firmware 3.02n (this also happened with 3.01 already).

@hmatuschek
Copy link
Owner

I need to update the APRS settings to the new FW versions anyway. Currently only one FM APRS frequency is supported.

@hmatuschek hmatuschek self-assigned this Jun 20, 2023
@hmatuschek hmatuschek added bug Something isn't working AT-D878UV Affects Anytone AT-D878UV devices AT-D868UV Affects Anytone AT-D868UV devices AT-D578UV Affects Anytone AT-D578UV devices AT-D878UVII Affects AnyTone AT-D878UV II devices DMR-6X2UV Affects BETCH DMR-6X2UV devices labels Jun 20, 2023
@hmatuschek hmatuschek added this to the Version 0.11.3 milestone Jun 20, 2023
@toco
Copy link
Author

toco commented Jun 20, 2023

Yeah and even that no longer works (or maybe now override it which it didn't before). I also think the config concept in the UI with multiple channels with different source/destination settings doesn't map correctly to the AnyTone capabilities, which is just one source/destination config for FM, but multiple frequencies that can be selected.

@hmatuschek
Copy link
Owner

hmatuschek commented Jun 20, 2023

I do not understand the need for one APRS configuration but several frequencies. If any, I would suspect to need it the other way around. However, to map that to the concept of qdmr, I would rather add an extension to the one FM-APRS setting allowed for anytone devices, that will hold the additional frequencies.

@toco
Copy link
Author

toco commented Jun 20, 2023

That sounds like a good way to do it.

@allesand
Copy link

Hello, I get

 40%] Building CXX object lib/CMakeFiles/libdmrconf.dir/d878uv_codeplug.cc.o
../qdmr/lib/d878uv_codeplug.cc: In member function ‘virtual bool D878UVCodeplug::APRSSettingsElement::fromAPRSSystem(const APRSSystem*, Codeplug::Context&, const ErrorStack&)’:
../qdmr/lib/d878uv_codeplug.cc:2618:3: error: ‘setFrequency’ was not declared in this scope; did you mean ‘Frequency’?
 2618 |   setFrequency(sys->revertChannel()->txFrequency()*1e6);
      |   ^~~~~~~~~~~~
      |   Frequency
../qdmr/lib/d878uv_codeplug.cc: In member function ‘virtual bool D878UVCodeplug::APRSSettingsElement::linkAPRSSystem(APRSSystem*, Codeplug::Context&)’:
../qdmr/lib/d878uv_codeplug.cc:2642:70: error: ‘frequency’ was not declared in this scope; did you mean ‘Frequency’?
 2642 |   FMChannel *ch = ctx.config()->channelList()->findFMChannelByTxFreq(frequency()/1e6);
      |                                                                      ^~~~~~~~~
      |                                                                      Frequency
make[2]: *** [lib/CMakeFiles/libdmrconf.dir/build.make:1806: lib/CMakeFiles/libdmrconf.dir/d878uv_codeplug.cc.o] Fehler 1
make[1]: *** [CMakeFiles/Makefile2:170: lib/CMakeFiles/libdmrconf.dir/all] Fehler 2
make: *** [Makefile:156: all] Fehler 2

@hmatuschek
Copy link
Owner

This fix requires some rewriting of the present codeplug elements dealing with the positioning settings. So expect some mayhem before it gets better.

@hmatuschek
Copy link
Owner

Does anyone know, what this "pass all" option means?

@toco
Copy link
Author

toco commented Jun 24, 2023

Show all APRS message types AFAIK.

@hmatuschek
Copy link
Owner

Ok, thanks.

@toco
Copy link
Author

toco commented Jun 24, 2023

Small correction: PASS ALL shows messages even when they fail CRC checks.

Add new function in CPS->APRS-> Analog -> PASS ALL. Set On PASSALL will receive more APRS message, but some are with corrupted data.
Default OFF. This command enables the attempt to display corrupted packets when PASSALL is ON. When PASSALL is OFF, packets will be displayed only if the CRC (error checking) is correct.

https://groups.io/g/ANYTONE-878/topic/90505161?p=%2C%2C%2C20%2C0%2C0%2C0%3A%3A%2C%2C%2C0%2C0%2C0%2C90505161

@hmatuschek
Copy link
Owner

Ok, I was just puzzled, as this option is stored near the FM APRS transmission options. There is an separate memory region, where the FM APRS reception options are stored.

@allesand
Copy link

Hello, I get

 40%] Building CXX object lib/CMakeFiles/libdmrconf.dir/d878uv_codeplug.cc.o
../qdmr/lib/d878uv_codeplug.cc: In member function ‘virtual bool D878UVCodeplug::APRSSettingsElement::fromAPRSSystem(const APRSSystem*, Codeplug::Context&, const ErrorStack&)’:
../qdmr/lib/d878uv_codeplug.cc:2618:3: error: ‘setFrequency’ was not declared in this scope; did you mean ‘Frequency’?
 2618 |   setFrequency(sys->revertChannel()->txFrequency()*1e6);

Builds and runs ok now! Have to set up analog APRS to test, though.

@allesand
Copy link

Status report: current version crashes when reading from 878. Writing works, it crashes after finishing:

Debug in lib/anytone_interface.cc@356: Anytone: Left program-mode.
Debug in lib/usbserial.cc@155: Serial port will close now.
Speicherzugriffsfehler (Speicherabzug geschrieben)

@hmatuschek
Copy link
Owner

hmatuschek commented Jul 4, 2023

Uh, that was a nasty one, smashed the stack a bit and got random crashes everywhere. Fortunately, there is valgrinds memcheck.

@hmatuschek
Copy link
Owner

Is there any means of selecting, which FM APRS frequency is used? I haven't found anything in the CPS.

@hmatuschek
Copy link
Owner

With the last commit, it is now possible to add and edit the additional FM APRS frequencies. There are only 7, the first is the default and is taken from the revert channel associated the the qdmr APRS system. There is now also a reference in the AnyTone FM and DMR channel extensions allowing to select the FM APRS frequency. If none is selected, the default (revert channel) is taken.

@hmatuschek
Copy link
Owner

I believe, this issue is now fixed. Just test the extension and let me know.

@allesand
Copy link

I can confirm that reading&writing the config works for both 868 and 878

@toco can you confirm the desired function?

@toco
Copy link
Author

toco commented Jul 13, 2023

I‘m out of country without my laptop. The Rasberry Pi I have with me runs into the Linux USB issue…
Can check next week.

@toco
Copy link
Author

toco commented Jul 19, 2023

Copied over from the other issue, had the wrong window open:

Tested on c457377. Things I noticed:

  1. I added two APRS frequencies in the config, on the HT the first one appears twice, the second one appears in the second slot.
  2. Report filters are always shown as "off" on device, even though I set some to "on".

@hmatuschek
Copy link
Owner

The second point should now be fixed now in this branch.

@toco
Copy link
Author

toco commented Jul 19, 2023

From the other thread

Concerning the first point: You can only define 7 additional FM APRS frequencies in the extension. The first frequency is set by the FM APRS system. That is, within the config:

Ah! With the explanation that makes sense.

@toco
Copy link
Author

toco commented Jul 19, 2023

Looks like it works now, thanks for the very quick turnaround time!

The only thing I'm missing is setting (or not resetting) the selected APRS frequency.

Differences in binary codeplug read from device after changing the selected frequency:

diff <(xxd APRS_freq_1.dfu) <(xxd APRS_freq_2.dfu) 
187c187
< 00000ba0: 0000 0000 0000 2080 0040 0000 0000 0000  ...... ..@......
---
> 00000ba0: 0001 0000 0000 2080 0040 0000 0000 0000  ...... ..@......
2048c2048
< 00007ff0: 10d8 c869 59                             ...iY
---
> 00007ff0: 10a5 d9cf b8                             .....
diff <(xxd APRS_freq_1.dfu) <(xxd APRS_freq_3.dfu)            
187c187
< 00000ba0: 0000 0000 0000 2080 0040 0000 0000 0000  ...... ..@......
---
> 00000ba0: 0002 0000 0000 2080 0040 0000 0000 0000  ...... ..@......
2048c2048
< 00007ff0: 10d8 c869 59                             ...iY
---
> 00007ff0: 1063 ec54 41                             .c.TA

@hmatuschek hmatuschek linked a pull request Jul 19, 2023 that will close this issue
@hmatuschek
Copy link
Owner

The frequency can be set in the Anytone extension of the channel. There you can select the FM APRS frequency. However, selecting none will select the default one specified in the FM APRS system. So, only the additional frequencies are selectable.

hmatuschek added a commit that referenced this issue Aug 14, 2023
* Documented changes in the APRS settings encoding. Addresses #349.
* Fixed exisiting props of APRSSettings.
* Merged FM and DMR APRS settings. Fixed frequency issue. Addresses #349.
* Fixed APRS settings for DMR6X2UV.
* Cleanup of DMR6X2UV codeplug.
* Fixed crash in D878UV read. Addresses #349.
* Added anytone settings extension for FM APRS systems. Addresses #249.
* Implemented FM APRS frequency list and experimental storage of labels. Addresses #349.
* Added some docs for FM APRS settings extension. Addresses #394.
* Fixed missing encoding/decoding of report flags for Anytone APRS settings extension.
* Fixed decoding of D878UV codeplugs of older DFU images.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AT-D578UV Affects Anytone AT-D578UV devices AT-D868UV Affects Anytone AT-D868UV devices AT-D878UV Affects Anytone AT-D878UV devices AT-D878UVII Affects AnyTone AT-D878UV II devices bug Something isn't working DMR-6X2UV Affects BETCH DMR-6X2UV devices
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants