Giter VIP home page Giter VIP logo

linuxscripts's People

Contributors

deepfriedfilth avatar ggeorgovassilis avatar marukuru avatar mscalora avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

linuxscripts's Issues

Command check always returns off although connection successful

Hello.

I'm trying to use your script to do 3 basic things:

  • ON --> seems to work OK (./tplink.sh IP 9999 on)
  • OFF --> seems to work OK (./tplink.sh IP 9999 off)
  • CHECK --> always returns OFF, even after doing ON before - seems NOK (./tplink.sh IP 9999 check).

It's an HS100 with Hardware version 1.0 and Firmware version 1.1.0 Build 160503 Rel.145047 (also tried in an HS110 with Hardware version 1.0 and Firmware version 1.0.8 Build 151101 Rel.24452 and result is the same).

Is there anything I can provide you for you to check, or am I doing something wrong?

Thanks in advance and kind regards.

Nordvpn-Proxy - Add authentication with Roundrobin

I've been trying to figure out how to properly do this, but how would you grab all of nord's servers that use socks proxy, and roundrobin between all of them? Also, including the authentication in the HAproxy configuration? Is it like reqadd Proxy-Authentication:?

hs100 Script doesn't check for 'discover' or 'list'

Hi! This is a wonderful script, but I've run into two things. Maybe I'm doing something wrong, but I don't think so. When I run:

sudo hs100.sh discover

the script asks for the IP address. In perusing your code, I found that it doesn't seem to look for anything other than the IP and port. Here's my dumb little hack that made it work for me:

check_arguments() {
   if [ $BASH_ARGV[1] != "discover" ] && [ $BASH_ARGV[1] != "list" ]; then
       check_arg() {
          name="$1"
          value="$2"
          if [ -z "$value" ]; then
             echo "missing argument $name"
             usage
          fi
       }
       check_arg "ip" $plugs
       check_arg "port" $port
       check_arg "cmd_dis" $cmd
    fi
}

Also, when I do discovery, it picks up an IP camera on the network and throws it in the list, which I think is because the IP camera has port 9999 open. Just FYI.

One last thing: Would you consider implementing the {"system":{"reboot":{"delay":1}}} function? I'm using the code to reset a funky POE switch that the computer happens to be connected to, thus it's a bit tough to turn the thing back on through code!

Thank you so much!

working for hs110 too

hello,

i can confirm that your code is also working for the HS110 model.

i would like to flash a custom image with a simple REST interface to control the smart plug.

kind regards, werty

hs100: new schedule_off command (code included)

Hi
Here is my small contribution to the script: a way to shedule to turn off the plug (hardcoded to 30 minutes). If called another time, the last call cancel any previous schedule and reset the schedule to 30 min.

I trigger that command when a printer finish its job, in order to turn off that printer after a while, if no other print job is launched (in which case, the timeout is reset to 30 min on each print job).

cmd_schedule_switch_off(){
  # Cancel any scheduled turn-off
  # Browse all AT tasks and, for those containing the script name ($0), ask AT to stop them
  for j in $(atq | cut -f 1);
  do
    if at -c $j | grep -q $0; then
		echo Stop scheduled turn-off task $j
		at -r $j
	fi
  done
  
  # Schedule in 30 minutes to turn off the plug
  echo "$0 $ip $port off" | at now+30minute
}

NC program error on hasbian image raspberry

Hi,

I installed openhab on raspberry using hasbian and when i launch the script using this command:

sudo ./hs100.sh 192.168.0.200 9999 on

i am getting this message:

"The nc programme for sending data over the network isn't in the path, communication with the plug will fail

The same script with same command launched on my mac works without any issue..

What does the message mean?

Thank you

Curious how to modify it for own use.

Hi George,

I'm new to HA and all the scripting. I was wondering what values you changed in the script for use with your own IP etc? I can't figure out from the script which values to change myself.

Also - do you happen to share the switch code you used in HA? Thank you so much!

binary characters found in status payload

I found that running the status payload was returning binary characters, adjusting cmd_print_plug_relay_state() to the following strips it out (added tr -cd '\11\12\15\40-\176'):

output=send_to_plug $ip $port "$payload_query" | decode | tr -cd '\11\12\15\40-\176' | egrep -o 'relay_state":[0,1]' | egrep -o '[0,1]'

check/status broken (with latest firmware?)

I'm running on an HS100, HW version 2.0, FW version 1.5.6 (as reported by Kasa App).

When running, I get an error and invalid result from "check" (my device is actually ON in the test below):

$ ./hs100.sh 192.168.1.25 9999 check
args are 192.168.1.25 9999 check
Connection to 192.168.1.25 9999 port [tcp/*] succeeded!
od: cannot skip past end of combined input
OFF

The reason is that in send_to_plug(), netcat returns nothing even though the payload is send successfully, and od complains about no input. I'm suspecting this broke in later firmware.

Also note: the on/off commands work perfectly. They don't need any output to work, of course.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.