TheThingsNetwork / lorawan-devices

Device Repository for LoRaWAN devices
Apache License 2.0
184 stars 361 forks source link

Add a setup script #693

Closed LDannijs closed 2 months ago

LDannijs commented 8 months ago

Summary

At the moment, users are required to create a bunch of files containing boilerplate code that they then need to edit whenever they want to add a vendor or new devices. This PR add 2 scripts that create all of the files by just entering a few questions. I'd like to receive feedback on what other changes could be made to improve it.

This is an in between feature, idea is that eventually a type of form will be used for the repo, but for now this should at least be helpful.

(recreated this PR cause i had some organizing of my fork)

Changes

Preview of what the scripts look like. image

image

Jaime-Trinidad commented 7 months ago

@johanstokking can you take a look to @LDannijs work here

LDannijs commented 7 months ago

Decided to make it even easier by just compacting it all down to 1 script with a selection menu. Preview:

Screenshot 2023-11-27 at 15 05 49
LDannijs commented 7 months ago
  1. Add line breaks before 80 characters (that is the max line length)

Would I need to do this for only the echo commands or the entire code?

johanstokking commented 7 months ago

Ideally both but certainly anything printed.

LDannijs commented 7 months ago

I hope the NO_COLOR variable is properly implemented. It doesnt seem to be that standardized so I hope this is good.

johanstokking commented 7 months ago

@Jaime-Trinidad did you test this locally?

Jaime-Trinidad commented 7 months ago

Yes, there are some fixes to do:

Codec: Just fill uplinkDecoder with the decoder file name, few device makers fill downlinkEncoder and downlinkDecoder and they won't notice and cause errors.

Profile: Same can we leave macVersion empty it fills with 1.0.3 some of them may think it is ok and won't change it, so they probably don't autofill the info.

Index: @LDannijs check because I added from an existing vendor and it deletes the already info:

image
LDannijs commented 7 months ago

(apologies for messing up the commit history. There were commits from a different branch that i had accidentally been using on here, so i tried to fix it 😓. Need to learn to double check these things)

LDannijs commented 7 months ago

So few changes made:

johanstokking commented 5 months ago

Please ping @Jaime-Trinidad to review and test.

LDannijs commented 4 months ago

Did a few things:

LDannijs commented 3 months ago

Turned the command to run the script into a make command to match the other commands.

And with #736 now being merged i can reopen this PR.