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

0.1.7 scp doesn't seem to be working #166

Open
gewinh opened this issue Apr 18, 2024 · 10 comments
Open

0.1.7 scp doesn't seem to be working #166

gewinh opened this issue Apr 18, 2024 · 10 comments

Comments

@gewinh
Copy link

gewinh commented Apr 18, 2024

Hi back after a long absence. I have had a number of Sonoff cameras running on 0.1.5 and integrated in to HA with great success for over 12 months( thanks for all the work)(this system has been frozen version wise for this period). Now in a moment of madness I have decided to update everything (pi5 ubuntu HA etc etc). One of the changes has been to try 0.1.7 most things I have tested on a new Sonoff Cam slim using the GK-200MP2-B_0.1.7 are working well, except scp. ssh is working,
If I ssh to this camera running 0.1.5 and execute the scp command I get some stuff about usage, so the command is working. If I ssh to this camera running 0.1.7 and execute the scp command I get "command not found".
Is this a path thing?
I notice an issue raised for 0.1.6 to fix scp , is this the same issue for 0.1.7 if so how do I fix it.
The one thing I didn't want to change, if possible, is my nightly server scp copying of previous days recording from each camera on the network. SO it would be great to get scp working

@gewinh
Copy link
Author

gewinh commented Apr 19, 2024

Did some further investigation scp is in the 0.1.7 distribution. You can run it via /mnt/mmc/sonoff-hack/bin/scp.

Tried 2 temp fixes

A)Created a link to this by

  1. ssh to the camera
    2.cd /usr/bin
    3.ln -s /mnt/mmc/sonoff-hack/bin/scp
    scp works
    This doesn't survive a reboot

B)Looked at adding /mnt/mmc/sonoff-hack/bin to PATH
existing Path looks like
echo $PATH
/usr/bin:/usr/sbin:/bin:/sbin:/gm/bin:/gm/tools:/tmp/sd/yi-hack/bin:/tmp/sd/yi-hack/sbin:/tmp/sd/yi-hack/usr/bin:/tmp/sd/yi-hack/usr/sbin
PATH="$PATH:/mnt/mmc/sonoff-hack/bin"
echo $PATH
/usr/bin:/usr/sbin:/bin:/sbin:/gm/bin:/gm/tools:/tmp/sd/yi-hack/bin:/tmp/sd/yi-hack/sbin:/tmp/sd/yi-hack/usr/bin:/tmp/sd/yi-hack/usr/sbin:/mnt/mmc/sonoff-hack/bin
scp works
This change doesn't survive logout

Forgive my ignorance but I do not know how to make any of these changes permanent or how to update the distribution to include a fix. Any help?

@gewinh
Copy link
Author

gewinh commented Apr 19, 2024

A bit more info.
I see /mnt/mmc/sonoff-hack/scripts/system.sh called by boot.sh
system.sh sets the path in
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/mnt/mmc/sonoff-hack/lib
export PATH=$PATH:/mnt/mmc/sonoff-hack/bin:/mnt/mmc/sonoff-hack/sbin:/mnt/mmc/sonoff-hack/usr/bin:/mnt/mmc/sonoff-hack/usr/sbin
but this path isn't there on boot, if it was run correctly and the path was set as above scp would work. I also noticed a problem with filezilla access giving sftp error. Again I would guess this is related to the path not being set correctly.

@darkxst
Copy link
Contributor

darkxst commented Apr 19, 2024

I think the path on ssh login is set in Dropbear

https://github.com/roleoroleo/sonoff-hack/blob/master/src/dropbear/localoptions.h

@darkxst
Copy link
Contributor

darkxst commented Apr 19, 2024

paths got messed up in this commit:
9bd2e3d#diff-0c5450329c3e310a6a4ffd3041cfb1f656d34cfcc18a7052ea0b9d44f2acf371

@gewinh
Copy link
Author

gewinh commented Apr 19, 2024

Thanks. Yes I couldn't understand why all that yi-hack stuff was in the path when i'm running the sonoff-hack. It's beyond my skills to fix that. Hopefully someone will find the time to fix it.

@darkxst
Copy link
Contributor

darkxst commented Apr 19, 2024

@gewinh you could do a local build off PR #167 to test changes. I dont currently have access to my sonoff cams.

@gewinh
Copy link
Author

gewinh commented Apr 19, 2024

Thanks for doing this. Unfortunately I can get my head around how to do a local build. Install the toolchain? , vscode, development environment, dockers etc. etc. I think I will have to wait until the fix is incorporated into a release.

@gewinh
Copy link
Author

gewinh commented Apr 20, 2024

This old brain works a bit slowly these days. Finally sorted all the dependencies, paths etc. and got he updated 0.1.7 built. Installed on a GK-200MP2-B camera and scp and filezilla are now working. The PATH now looks correct. Will test on the Sonoff 1080p slim cam and the HA integration later. Thanks for all your help.

@gewinh
Copy link
Author

gewinh commented Apr 20, 2024

Tested on the Sonoff 1080p slim cam using firmware 0.1.7 all works fine, except for camera on/off as described in issue 0.1.7 camera on/off not working for some firmware

@roleoroleo
Copy link
Owner

roleoroleo commented Apr 20, 2024

Sorry for this regression.
Below a binary with the fix posted by @darkxst:
dropbearmulti.gz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants