question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error when running samsungctl

See original GitHub issue

Hi, Thanks for continuing and improving samsungctl - I’m looking forward to the increased number of available keys. I am currently getting this error when running the c611b77 commit of master:

python -m samsungctl --host 192.168.123.203 --port 8002 --method websocket KEY_HDMI error from callback <bound method RemoteWebsocket.on_open of <samsungctl.remote_websocket.RemoteWebsocket object at 0xf68872b0>>: on_open() missing 1 required positional argument: 'ws' Traceback (most recent call last): File "/usr/local/lib/python3.6/runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "/usr/local/lib/python3.6/runpy.py", line 85, in _run_code exec(code, run_globals) File "/samsungctl/samsungctl/__main__.py", line 206, in <module> main() File "/samsungctl/samsungctl/__main__.py", line 181, in main with Remote(config) as remote: File "/samsungctl/samsungctl/remote.py", line 13, in __init__ self.remote = RemoteWebsocket(config) File "/samsungctl/samsungctl/remote_websocket.py", line 50, in __init__ self.open() File "/samsungctl/samsungctl/remote_websocket.py", line 124, in open raise RuntimeError('Connection Failure') RuntimeError: Connection Failure error from callback <bound method RemoteWebsocket.on_message of <samsungctl.remote_websocket.RemoteWebsocket object at 0xf68872b0>>: on_message() missing 1 required positional argument: 'message' ^CException ignored in: <module 'threading' from '/usr/local/lib/python3.6/threading.py'> Traceback (most recent call last): File "/usr/local/lib/python3.6/threading.py", line 1294, in _shutdown t.join() File "/usr/local/lib/python3.6/threading.py", line 1056, in join self._wait_for_tstate_lock() File "/usr/local/lib/python3.6/threading.py", line 1072, in _wait_for_tstate_lock elif lock.acquire(block, timeout): KeyboardInterrupt root@4ac25b2493d0:/samsungctl# cat ~/.samsungctl/token.txt root@4ac25b2493d0:/samsungctl#

The “error from callback <bound method RemoteWebsocket.on_open of <samsungctl.remote_websocket.RemoteWebsocket object at 0xf68872b0>>: on_open() missing 1 required positional argument: ‘ws’” error appears before allowing the device on the TV. The “error from callback <bound method RemoteWebsocket.on_message of <samsungctl.remote_websocket.RemoteWebsocket object at 0xf68872b0>>: on_message() missing 1 required positional argument: ‘message’” error appears after allowng the device on the TV. Nothing is being written to token.txt. I have tried with both python 2 and 3 and both exhibit the same issue, with 3 handling the crashes better.

TV info:

{"device":{"FrameTVSupport":"false","GamePadSupport":"true","ImeSyncedSupport":"true","OS":"Tizen","TokenAuthSupport":"true","VoiceSupport":"true","countryCode":"AU","description":"Samsung DTV RCR","developerIP":"0.0.0.0","developerMode":"0","duid":"uuid:f3955515-4088-483a-b1e5-d11a95d2a1a7","firmwareVersion":"Unknown","id":"uuid:f3955515-4088-483a-b1e5-d11a95d2a1a7","ip":"192.168.123.203","model":"17_KANTM_UHD","modelName":"UA65MU7000","name":"[TV] Samsung 7 Series (65)","networkType":"wired","resolution":"3840x2160","smartHubAgreement":"true","type":"Samsung SmartTV","udn":"uuid:f3955515-4088-483a-b1e5-d11a95d2a1a7","wifiMac":"68:27:37:e9:f9:02"},"id":"uuid:f3955515-4088-483a-b1e5-d11a95d2a1a7","isSupport":"{\"DMP_DRM_PLAYREADY\":\"false\",\"DMP_DRM_WIDEVINE\":\"false\",\"DMP_available\":\"true\",\"EDEN_available\":\"true\",\"FrameTVSupport\":\"false\",\"ImeSyncedSupport\":\"true\",\"TokenAuthSupport\":\"true\",\"remote_available\":\"true\",\"remote_fourDirections\":\"true\",\"remote_touchPad\":\"true\",\"remote_voiceControl\":\"true\"}\n","name":"[TV] Samsung 7 Series (65)","remote":"1.0","type":"Samsung SmartTV","uri":"http://192.168.123.203:8001/api/v2/","version":"2.0.25"}

Any help with this is greatly appreciated

EDIT for readability, pastebin link to info above

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:12 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
kdschlossercommented, Dec 27, 2018

nice little tip about posting the errors like that huh?? there is a whole slew of them

apache

# rewrite`s rules for wordpress pretty url
LoadModule rewrite_module  modules/mod_rewrite.so
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [NC,L]

ExpiresActive On
ExpiresByType application/x-javascript  "access plus 1 days"

Order Deny,Allow
Allow from All

<Location /maps/>
  RewriteMap map txt:map.txt
  RewriteMap lower int:tolower
  RewriteCond %{REQUEST_URI} ^/([^/.]+)\.html$ [NC]
  RewriteCond ${map:${lower:%1}|NOT_FOUND} !NOT_FOUND
  RewriteRule .? /index.php?q=${map:${lower:%1}} [NC,L]
</Location>

bash

#!/bin/bash

###### CONFIG
ACCEPTED_HOSTS="/root/.hag_accepted.conf"
BE_VERBOSE=false

if [ "$UID" -ne 0 ]
then
 echo "Superuser rights required"
 exit 2
fi

genApacheConf(){
 echo -e "# Host ${HOME_DIR}$1/$2 :"
}

coffeescript

grade = (student, period=(if b? then 7 else 6)) ->
  if student.excellentWork
    "A+"
  else if student.okayStuff
    if student.triedHard then "B" else "B-"
  else
    "C"

class Animal extends Being
  constructor: (@name) ->

  move: (meters) ->
    alert @name + " moved #{meters}m."

c++

#include <iostream>

int main(int argc, char *argv[]) {

  /* An annoying "Hello World" example */
  for (auto i = 0; i < 0xFFFF; i++)
    cout << "Hello, World!" << endl;

  char c = '\n';
  unordered_map <string, vector<string> > m;
  m["key"] = "\\\\"; // this is an error

  return -2e3 + 12l;
}

c#

using System.IO.Compression;

#pragma warning disable 414, 3021

namespace MyApplication
{
    [Obsolete("...")]
    class Program : IInterface
    {
        public static List<int> JustDoIt(int count)
        {
            Console.WriteLine($"Hello {Name}!");
            return new List<int>(new int[] { 1, 2, 3 })
        }
    }
}

css

@font-face {
  font-family: Chunkfive; src: url('Chunkfive.otf');
}

body, .usertext {
  color: #F0F0F0; background: #600;
  font-family: Chunkfive, sans;
}

@import url(print.css);
@media print {
  a[href^=http]::after {
    content: attr(href)
  }
}

diff

Index: languages/ini.js
===================================================================
--- languages/ini.js    (revision 199)
+++ languages/ini.js    (revision 200)
@@ -1,8 +1,7 @@
 hljs.LANGUAGES.ini =
 {
   case_insensitive: true,
-  defaultMode:
-  {
+  defaultMode: {
     contains: ['comment', 'title', 'setting'],
     illegal: '[^\\s]'
   },

*** /path/to/original timestamp
--- /path/to/new      timestamp
***************
*** 1,3 ****
--- 1,9 ----
+ This is an important
+ notice! It should
+ therefore be located at
+ the beginning of this
+ document!

! compress the size of the
! changes.

  It is important to spell

http

POST /task?id=1 HTTP/1.1
Host: example.org
Content-Type: application/json; charset=utf-8
Content-Length: 137

{
  "status": "ok",
  "extended": true,
  "results": [
    {"value": 0, "type": "int64"},
    {"value": 1.0e+3, "type": "decimal"}
  ]
}

ini

; boilerplate
[package]
name = "some_name"
authors = ["Author"]
description = "This is \
a description"

[[lib]]
name = ${NAME}
default = True
auto = no
counter = 1_000

toml

; boilerplate
[package]
name = "some_name"
authors = ["Author"]
description = "This is \
a description"

[[lib]]
name = ${NAME}
default = True
auto = no
counter = 1_000

java

/**
 * @author John Smith <john.smith@example.com>
*/
package l2f.gameserver.model;

public abstract class L2Char extends L2Object {
  public static final Short ERROR = 0x0001;

  public void moveTo(int x, int y, int z) {
    _ai = null;
    log("Should not be called");
    if (1 > 5) { // wtf!?
      return;
    }
  }
}

javascript

function $initHighlight(block, cls) {
  try {
    if (cls.search(/\bno\-highlight\b/) != -1)
      return process(block, true, 0x0F) +
             ` class="${cls}"`;
  } catch (e) {
    /* handle exception */
  }
  for (var i = 0 / 2; i < classes.length; i++) {
    if (checkCondition(classes[i]) === undefined)
      console.log('undefined');
  }
}

export  $initHighlight;

json

[
  {
    "title": "apples",
    "count": [12000, 20000],
    "description": {"text": "...", "sensitive": false}
  },
  {
    "title": "oranges",
    "count": [17500, null],
    "description": {"text": "...", "sensitive": false}
  }
]

makefile

# Makefile

BUILDDIR      = _build
EXTRAS       ?= $(BUILDDIR)/extras

.PHONY: main clean

main:
	@echo "Building main facility..."
	build_main $(BUILDDIR)

clean:
	rm -rf $(BUILDDIR)/*

markdown

# hello world

you can write text [with links](http://example.com) inline or [link references][1].

* one _thing_ has *em*phasis
* two __things__ are **bold**

[1]: http://example.com

---

hello world
===========

<this_is inline="xml"></this_is>

> markdown is so cool

    so are code segments

1. one thing (yeah!)
2. two thing `i can write code`, and `more` wipee!

nginx

user  www www;
worker_processes  2;
pid /var/run/nginx.pid;
error_log  /var/log/nginx.error_log  debug | info | notice | warn | error | crit;

events {
    connections   2000;
    use kqueue | rtsig | epoll | /dev/poll | select | poll;
}

http {
    log_format main      '$remote_addr - $remote_user [$time_local] '
                         '"$request" $status $bytes_sent '
                         '"$http_referer" "$http_user_agent" '
                         '"$gzip_ratio"';

    send_timeout 3m;
    client_header_buffer_size 1k;
}

objective-c

#import <UIKit/UIKit.h>
#import "Dependency.h"

@protocol WorldDataSource
@optional
- (NSString*)worldName;
@required
- (BOOL)allowsToLive;
@end

@property (nonatomic, readonly) NSString *title;
- (IBAction) show;
@end

perl

# loads object
sub load
{
  my $flds = $c->db_load($id,@_) || do {
    Carp::carp "Can`t load (class: $c, id: $id): '$!'"; return undef
  };
  my $o = $c->_perl_new();
  $id12 = $id / 24 / 3600;
  $o->{'ID'} = $id12 + 123;
  #$o->{'SHCUT'} = $flds->{'SHCUT'};
  my $p = $o->props;
  my $vt;
  $string =~ m/^sought_text$/;
  $items = split //, 'abc';
  $string //= "bar";
  for my $key (keys %$p)
  {
    if(${$vt.'::property'}) {
      $o->{$key . '_real'} = $flds->{$key};
      tie $o->{$key}, 'CMSBuilder::Property', $o, $key;
    }
  }

php

require_once 'Zend/Uri/Http.php';

namespace Location\Web;

interface Factory
{
    static function _factory();
}

abstract class URI extends BaseURI implements Factory
{
    abstract function test();

    public static $st1 = 1;
    const ME = "Yo";
    var $list = NULL;
    private $var;

    /**
     * Returns a URI
     *
     * @return URI
     */

powershell (ps)

if ( $HOME[0] -eq '/' ) {

	# Linux: lshw/smartctl/df commands

 

	Write-Host "Volume   `tStatus`tCapacity`tModel" -ForegroundColor White

	Write-Host "======   `t======`t========`t=====`n" -ForegroundColor White

 

	( . lshw -short -class disk ) -match "/dev/" | ForEach-Object {

		$disk = ( $_.trim( ) -split '\s+',  3 )[1]

		$name = ( $_.trim( ) -split 'disk', 2 )[1].trim( )

		if ( $disk -notmatch "(/cd|/dvd|/sr)" ) {

			try {

				$size = 0

				$size = ( ( ( . df -l --output=source,size ) -match $disk ) -split '\s+', 2 )[1] / 1MB

				if ( $size -gt 0 ) {

					$test = ( ( ( . smartctl -H $disk ) -match "SMART [^\n\r]+: ([A-Z]+)" ) -split ":" )[1].trim( )

					Write-Host "$disk`t" -ForegroundColor White -NoNewline

					if ( $test -eq "PASSED" ) {

						$fgc = "Green"

					} else {

						$fgc = "Red"

						$rc = 1

					}

					Write-Host "$test`t" -ForegroundColor $fgc -NoNewline

					Write-Host ( "{0,5:N0} GB`t$name" -f $size ) -ForegroundColor White

				}

			}

			catch {

				# ignore errors from USB sticks etc.

			}

		}

	}

}

properties

# .properties
! Exclamation mark = comments, too

key1 = value1
key2 : value2
key3   value3
key\ spaces multiline\
            value4
empty_key
! Key can contain escaped chars
\:\= = value5

python

@requires_authorization
def somefunc(param1='', param2=0):
    r'''A docstring'''
    if param1 > param2: # interesting
        print 'Gre\'ater'
    return (param2 - param1 + 1 + 0b10l) or None

class SomeClass:
    pass

>>> message = '''interpreter
... prompt'''

ruby

# The Greeter class
class Greeter
  def initialize(name)
    @name = name.capitalize
  end

  def salute
    puts "Hello #{@name}!"
  end
end

g = Greeter.new("world")
g.salute

shell

$ echo $EDITOR
vim
$ git checkout master
Switched to branch 'master'
Your branch is up-to-date with 'origin/master'.
$ git push
Everything up-to-date
$ echo 'All
> done!'
All
done!

sql

CREATE TABLE "topic" (
    "id" serial NOT NULL PRIMARY KEY,
    "forum_id" integer NOT NULL,
    "subject" varchar(255) NOT NULL
);
ALTER TABLE "topic"
ADD CONSTRAINT forum_id FOREIGN KEY ("forum_id")
REFERENCES "forum" ("id");

-- Initials
insert into "topic" ("forum_id", "subject")
values (2, 'D''artagnian');

html

<!DOCTYPE html>
<title>Title</title>

<style>body {width: 500px;}</style>

<script type="application/javascript">
  function $init() {return true;}
</script>

<body>
  <p checked class="title" id='title'>Title</p>
  <!-- here goes the rest of the page -->
</body>

xml

<!DOCTYPE html>
<title>Title</title>

<style>body {width: 500px;}</style>

<script type="application/javascript">
  function $init() {return true;}
</script>

<body>
  <p checked class="title" id='title'>Title</p>
  <!-- here goes the rest of the page -->
</body>

yml

# Employee records
-  martin:
    name: Martin D'vloper
    job: Developer
    skills:
      - python
      - perl
      - pascal
-  tabitha:
    name: Tabitha Bitumen
    job: Developer
    skills:
      - lisp
      - fortran
      - erlang

and I am sure there are more i just can’t think of them off hand

1reaction
kdschlossercommented, Dec 27, 2018

I’m a dum dum…

This is my boo boo. It is because I am checking for the sock object before i even initialized the WebsocketApp.

This will be repaired in a jif.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Some TV models are not working · Issue #22 · Ape/samsungctl
When I run samsungctl --websocket everything runs fine with no error, but no response from the TV. After looking at the response from...
Read more >
Samsungctl python library not working for my smart tv NEED ...
I have spent a few weeks trying to figure out to connect my M series smarty tv to my computer through python using...
Read more >
samsungctl - PyPI
samsungctl is a library and a command line tool for remote controlling Samsung televisions via TCP/IP connection. Dependencies. samsungctl requires Python 3 ...
Read more >
Samsung Tizen Support - Feature Requests
Got a new Samsung TV running Tizen which does not appear to be supported ... I get this error: samsungctl: error: argument -h/–help:...
Read more >
samsungctl - Bountysource
Running setup.py bdist_wheel for samsungctl ... done ... i have this message : Error : Connection refused when i execute the command :...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found