Mason10198 / SkywarnPlus

Empowering Asterisk / app_rpt Nodes with Local Alert Intelligence
GNU General Public License v3.0
45 stars 3 forks source link

Update README.md #36

Closed nathantcampbell closed 1 year ago

nathantcampbell commented 1 year ago

DTMF > skydescribe example update. Command examples didn't specify python3 run folder; wasn't working without it on hamvoip.

Mason10198 commented 1 year ago

Nathan, look at the very first line of all SWP .py files and you will see a shebang (#!/usr/bin/python3) for the Python interpreter. You should never have to specify the interpreter from the command line since these are included in the scripts. I have tested the scripts on both HAMVOIP and ASL with direct calls and they worked fine. Perhaps something is different with your system?

nathantcampbell commented 1 year ago

Interesting yeah I'm not sure, I'll send you the error I'm getting when I get back home this afternoon.

Nathan

On Sat, Jul 1, 2023, 12:51 PM Mason10198 @.***> wrote:

Nathan, look at the very first line of all SWP .py files and you will see a shebang (#!/usr/bin/python3) for the Python interpreter. You should never have to specify the interpreter from the command line since these are included in the scripts. I have tested the scripts on both HAMVOIP and ASL with direct calls and they worked fine. Perhaps something is different with your system?

— Reply to this email directly, view it on GitHub https://github.com/Mason10198/SkywarnPlus/pull/36#issuecomment-1616067181, or unsubscribe https://github.com/notifications/unsubscribe-auth/AF44PQPXR4LKG6PB7R3NCFLXOB5UVANCNFSM6AAAAAAZ27HQ3I . You are receiving this because you authored the thread.Message ID: @.***>

Mason10198 commented 1 year ago

OK. If it's something like /usr/bin/python^M: bad interpreter, then that means you have DOS line endings in your code. I run my source files through dos2unix before packaging the release ZIP, so if you downloaded and extracted the Github release that should not occur unless you opened the scripts on a Windows PC and modified them.

mjwgeek commented 1 year ago

I was getting that issue during testing and I used this to clean them in place:

sed -i -e 's/\r$//' name_of_file.py

That removes all of the DOS line endings.

nathantcampbell commented 1 year ago

I'm editing the files in notepad++ tied through winSCP. Every time you save the file and notepad++ It saves it to a temp folder prompting winSCP to push the update over SFTP, maybe that's why. If that's the reason why I'll just keep my modification in place if it's going to work it every time I open it config file and resave it and we can disregard the pull request.

Nathan

On Sat, Jul 1, 2023, 1:26 PM mjwgeek @.***> wrote:

I was getting that issue during testing and I used this to clean them in place:

sed -i -e 's/\r$//' name_of_file.py

That removes all of the DOS line endings.

— Reply to this email directly, view it on GitHub https://github.com/Mason10198/SkywarnPlus/pull/36#issuecomment-1616089307, or unsubscribe https://github.com/notifications/unsubscribe-auth/AF44PQPTM5ULGP2CBUZSWNLXOCBYPANCNFSM6AAAAAAZ27HQ3I . You are receiving this because you authored the thread.Message ID: @.***>

Mason10198 commented 1 year ago

Yep, that's it, if you've modified anything other than config.yaml anyways. Notepad++ has an indicator in the bottom-right for which EOL character format it's currently using, and you can change it.

I only hesitate on this PR because I'm trying to keep everything as simple and user-friendly as possible by keeping the interpreter spec "automatic", thereby keeping config lines shorter and less room for setup error. Let us know if you find this to only be specific to your scenario, or if you feel the PR is still valid.

nathantcampbell commented 1 year ago

So here's what I get without /usr/bin/python3 preceding in the macro command. I don't get any audio, just the standard courtesy tone.. [image: image.png]

Here's whatI get with it and I hear the audio of the description.

[image: image.png]

I installed it using the new process of downloading and extracting the zip. I had previously moved the old folder to "SkywarnPlus_old".

I hadn't opened any of the *.py files in notepad++. Just the rpt.conf and the config.yaml. It shows I'm using Unix (LF) formatting. [image: image.png]

Here's the config in the macro with and without. [image: image.png]

I don't see anything weird on the SkyDescribe in nano. [image: image.png]

I also don't see anything weird in rpt.conf [image: image.png]

Nathan Campbell

On Sat, Jul 1, 2023 at 2:10 PM Mason10198 @.***> wrote:

Yep, that's it, if you've modified anything other than config.yaml anyways. Notepad++ has an indicator in the bottom-right for which EOL character format it's currently using, and you can change it.

I only hesitate on this PR because I'm trying to keep everything as simple and user-friendly as possible by keeping the interpreter spec "automatic", thereby keeping config lines shorter and less room for setup error. Let us know if you find this to only be specific to your scenario, or if you feel the PR is still valid.

— Reply to this email directly, view it on GitHub https://github.com/Mason10198/SkywarnPlus/pull/36#issuecomment-1616115987, or unsubscribe https://github.com/notifications/unsubscribe-auth/AF44PQOM4XYTGWOLXQKQ4RTXOCG3BANCNFSM6AAAAAAZ27HQ3I . You are receiving this because you authored the thread.Message ID: @.***>

Mason10198 commented 1 year ago

Thank you very much for the detailed information. Makes trying to help MUCH more effective.

Is this ASL or HAMVOIP and what version? Is python up to date? What happens if you execute /usr/local/bin/SkywarnPlus/SkyDescribe.py 1 manually from the OS command line? What happens if you try executing it manually from the Asterisk command line? You could also try sending the output to a file to catch any errors coming up when Asterisk calls the script. Just put >> /path/to/log.txt at the end of your command definition in rpt.conf.

nathantcampbell commented 1 year ago

Well I think I figured it out. I forgot to set execution permission on the *.py files in the SkywarnPlus folder after reinstalling. I didn't notice because my crontab defines /usr/bin/python3

You can close this out as a failure to follow the README.md 😎

Nathan Campbell

On Sat, Jul 1, 2023 at 5:59 PM Mason10198 @.***> wrote:

Thank you very much for the detailed information. Makes trying to help MUCH more effective.

Is this ASL or HAMVOIP and what version? Is python up to date? What happens if you execute /usr/local/bin/SkywarnPlus/SkyDescribe.py 1 manually from the OS command line? What happens if you try executing it manually from the Asterisk command line? You could also try sending the output to a file to catch any errors coming up when Asterisk calls the script. Just put >> /path/to/log.txt at the end of your command definition in rpt.conf.

— Reply to this email directly, view it on GitHub https://github.com/Mason10198/SkywarnPlus/pull/36#issuecomment-1616248635, or unsubscribe https://github.com/notifications/unsubscribe-auth/AF44PQLEQR54E5JKMG5PYV3XODBV7ANCNFSM6AAAAAAZ27HQ3I . You are receiving this because you authored the thread.Message ID: @.***>

Mason10198 commented 1 year ago

Ah, that'll do it. Glad you got it figured out! 👍