profile
viewpoint
Nathan Henrie n8henrie n8henrie.com Shiprock, NM https://n8henrie.com Tech nerd, dad, physician.

n8henrie/alexa-wolfram-alpha 22

Use your Amazon Echo (Alexa) to query Wolfram Alpha.

n8henrie/advent2018-rust 2

Advent of Code 2018, in rust

n8henrie/cookiecutter-lambda 2

A cookiecutter or AWS Lambda functions

n8henrie/cookiecutter_gae_flask 2

Cookiecutter for Flask apps destined for Google Apps Engine

n8henrie/arch-installer 1

An Archiso-based project to automatically perform a clean installation of Arch Linux on my Macbook Pro.

n8henrie/duckdns 1

Python script and systemd service and timer files to use dynamic dns from duckdns.org on your Raspberry Pi.

n8henrie/ale 0

Asynchronous linting/fixing for Vim and Language Server Protocol (LSP) integration

n8henrie/appdaemon 0

:page_facing_up: Python Apps for Home Assistant

n8henrie/asyncio_download 0

Asyncio examples and comparisons, purely for my learning and benefit.

n8henrie/AudioKit 0

Swift audio synthesis, processing, & analysis platform for iOS, macOS and tvOS

pull request commentfail2ban/fail2ban

Add a note about `journalflags` options to `systemd-journal` backend

There hasn't been any conversation on this in a little while -- just wanting to make sure that there are no additional changes I should make to expedite the process. (In other words, "you're not waiting on me, are you?")

n8henrie

comment created time in a day

issue commentcceremuga/pypacket

SSID is not stripped from username

Hmm, while this fixes my ability to submit received packets, it looks like my igate beacon is still getting posted as KI5AYO (instead of KI5AYO-0, which I have set as my username).

Perhaps this should just be a documentation PR that specifies that the username should not include an SSID?

Or perhaps that should already be assumed, and I'm just new around here. Regardless, thanks for a great looking library!

n8henrie

comment created time in 5 days

issue commentn8henrie/fauxmo

Emulate TV

I'm not sure what you mean about DNS. Fauxmo would definitely be able to make some of those API calls locally.

Is Fauxmo the right solution for me?

I don't think so. It is limited to alexa turn on [device name] or alexa turn off [device name], I don't know of a good way to implement changing channels. You may be able to find a workaround with Routines, but I'll leave that investigation up to you.

Bobsilvio

comment created time in 6 days

issue closedn8henrie/fauxmo

Emulate TV

Hello I have recently been approaching alexa. I created a skill (name = mediaserver control) for a mediaserver (linux) that I have at home, with internal API to call the commands http://192.168.178.100/api/switchon. Alexa ask mediaserver control turn on (turn off) Mediaserver Alexa ask mediaserver control to change channel on 6 (http://192.168.178.100/api/switchannel=6) and other commands Alexa doesn't read local IPs, so you have to use DNS. I was looking for a solution to emulate the mediaserver from linux like a TV to pass commands directly without using DNS (which needs to open ports) and also to launch commands like Alexa turn on mediaserver alexa changes the channel of the media server on 9

Is Fauxmo the right solution for me? I've tested the recognition and it works, but sees it as a catch. Do you know similar solutions? thank you

closed time in 6 days

Bobsilvio

PR opened cceremuga/pypacket

Strip off SSID for login purposes

Leave SSID intact for beaconing though.

Fixes #64

+4 -0

0 comment

1 changed file

pr created time in 6 days

create barnchn8henrie/pypacket

branch : issue_64

created branch time in 6 days

issue openedcceremuga/pypacket

SSID is not stripped from username

Describe the bug A clear and concise description of what the bug is.

With the current implementation, if a user's SSID is included in the username, it is also included in the attempted login to AIS.

Unfortunately, I am unable to successfully transmit a packet, using aprslib directly, if I try to log in with an SSID attacked to my username.

To Reproduce Steps to reproduce the behavior:

import aprslib
IS = aprslib.IS("KI5AYO-0", passwd=12345)
IS.connect()
IS.sendall("KI5AYO-0>APDW15[REDACTED]\r\n")

If I replace IS = aprslib.IS("KI5AYO-0", passwd=12345) with IS = aprslib.IS("KI5AYO", passwd=12345), it works fine.

Expected behavior A clear and concise description of what you expected to happen.

The login should be processed without the SSID, but subsequent calls to aprslib's .sendall should include the SSID.

System info (please complete the following information):

  • OS: MacOS Catalina, Raspbian Buster
  • Python Version 3.8.5
  • PyPacket Version 5.0

PR incoming

created time in 6 days

create barnchn8henrie/pypacket

branch : issue_62

created branch time in 6 days

PR opened cceremuga/pypacket

Include altitude in the human-readable output

See issue 62

+2 -0

0 comment

1 changed file

pr created time in 6 days

issue openedcceremuga/pypacket

Altitude not include in log output

I'm interested in using pypacket to track a high-altitude balloon project I'm working on. The default log output doesn't include altitude, which would be really helpful to let me know when I need to go find my balloon!

I've included a minor change in a PR with a working example (altitude is in meters).

created time in 6 days

fork n8henrie/pypacket

Modular APRS Rx IGate framework for RTL-SDR devices.

https://pypacket.app

fork in 6 days

issue commentn8henrie/fauxmo

Echo Dot, NOW not discovering fauxmo

Thanks for the followup. This has been my experience a number of times; wish I had a better idea of how to troubleshoot it!

mocallins

comment created time in 7 days

issue openedencode/orm

Is there a way to support alternate column names?

I have a table that I'm trying to adapt from sqlalchemy in which a column name is a Python keyword (open). In my sqlalchemy table, I use open_ = Column("open", Float) so as to avoid overriding the keyword.

In my orm.Model, I'm unable to find a way to have an equivalent mapping of the mymodel.open_ object.

I tried open_ = orm.Float(name="open") but that isn't a supported kwarg.

open_ = orm.Float(title="open") doesn't work, resulting in asyncpg.exceptions.UndefinedColumnError: column tiingo_daily_historical.open_

Am I overlooking a way to do this?

Many thanks in advance!

created time in 11 days

push eventn8henrie/fauxmo

Nathan Henrie

commit sha bd668af8db2d3bf0b7f392a582ac8f6cf6fb9c5a

Update to 3.8.5

view details

Nathan Henrie

commit sha df818afb9c19d18d5472888cc69041eb8b6bc390

Update dependencies

view details

Nathan Henrie

commit sha d6d9b07e3742adc61f7eefee1a1dd7cf4ea6a2ac

Update to 3.8 syntax

view details

Nathan Henrie

commit sha 7f19d7e315e932fee5a506830593e0574896cf29

Move debug log until after port assignment

view details

Nathan Henrie

commit sha 1a92408dd153fe480da765532dec8916904f3e4c

Satisfy the gods of type checking

view details

Nathan Henrie

commit sha 53814ae4ac0f0d3ca66460725e7dd459ebb86b60

Add a readable default repr

view details

Nathan Henrie

commit sha d2009f169f19f0b8a58cd8cd943583567b66aebe

Remove unnecessary `path` key now that these are included by default

view details

push time in 11 days

issue commentn8henrie/fauxmo

Echo Dot, NOW not discovering fauxmo

Just for dev. Running tests, building docs, uploading wheels, etc.

mocallins

comment created time in 11 days

issue commentn8henrie/fauxmo

Echo Dot, NOW not discovering fauxmo

There are no third party dependencies.

mocallins

comment created time in 11 days

issue commentn8henrie/fauxmo

Echo Dot, NOW not discovering fauxmo

I just tried a copy of your CommandLinePlugin device and it worked fine (I had to discover devices twice for it to be picked up).

Not sure if this could be because you're on a different firmware. Will keep investigating.

mocallins

comment created time in 12 days

issue commentn8henrie/fauxmo

Echo Dot, NOW not discovering fauxmo

I'm assuming all those things have been corrected.

No, definitely not all. If there were changes made, they've been documented in the issue.

Many of them are similar issues that seem to go away on their own, and I have no idea why.

mocallins

comment created time in 12 days

issue commentn8henrie/fauxmo

Echo Dot, NOW not discovering fauxmo

Huh, not sure. Looks like Fauxmo is acting properly from what I can tell, not sure why your Echo isn't responding. They're obviously on the same network and able to communicate.

There are problems with multiple Amazon accounts trying to use the same devices -- is yours the only account in question?

Were the devices removed from the Alexa app after your SD card crashed?

mocallins

comment created time in 12 days

issue commentn8henrie/fauxmo

Echo Dot, NOW not discovering fauxmo

The debug output is immediately before that, which is why it isn't showing up above.

[ ] TODO: I should probably move that after the port is configured.

I wonder if it could be having trouble there in this case. Can you try using a fixed available port?

mocallins

comment created time in 13 days

issue commentn8henrie/fauxmo

Echo Dot, NOW not discovering fauxmo

U thought port was optional.

Looks like you're right. It's required to instantiate a device, but in fauxmo.py I put in a fallback: device["port"] = int(device.get("port", 0)) or get_unused_port().

mocallins

comment created time in 13 days

issue commentn8henrie/fauxmo

Echo Dot, NOW not discovering fauxmo

Also, as of fauxmo v0.5.0, commandline plugin is included with Fauxmo, so you shouldn't need path (I need to fix this in the documentation).

mocallins

comment created time in 13 days

issue commentn8henrie/fauxmo

Echo Dot, NOW not discovering fauxmo

You're missing port from your device config: https://github.com/n8henrie/fauxmo/blob/master/src/fauxmo/plugins/commandlineplugin.py

How is that evening running? Seems like it should crash since port is a positional arg...

mocallins

comment created time in 13 days

issue commentn8henrie/fauxmo

Echo Dot, NOW not discovering fauxmo

Fauxmo seems to be responding properly (2020-09-09 14:31:17 fauxmo:420 DEBUG Sending response to ('192.168.0.13', 50000) with mx 3.0:), I'm not sure why your Dot isn't replying with the devices.

Do you have any firewalls running?

mocallins

comment created time in 13 days

issue commentn8henrie/fauxmo

Echo Dot, NOW not discovering fauxmo

What happens after that in the debug log? That's all the output during setup -- is there any output after that, when you ask Alexa to discover devices?

mocallins

comment created time in 13 days

push eventn8henrie/exercism-exercises

Nathan Henrie

commit sha a42b15b2be629e0fdc06c5ea6f60a203d7455bab

First attempt at better error handling

view details

push time in 20 days

push eventn8henrie/website-copy

Nathan Henrie

commit sha f5bc3f6dbe5a65c52950efa54e78c05947cf6ce7

Use null for link text since it's the same as url

view details

push time in 20 days

push eventn8henrie/website-copy

Nathan Henrie

commit sha 16b6da661a8a1501059cc517c7f4a06b512a101c

Add n8henrie python bio

view details

push time in 20 days

PR opened exercism/website-copy

Add n8henrie python bio
+8 -0

0 comment

1 changed file

pr created time in 20 days

fork n8henrie/website-copy

A repository for exercism's website's copy

fork in 20 days

push eventn8henrie/exercism-exercises

Nathan Henrie

commit sha 8038c89c54827b664937c9495d515bfe55274b86

Initialize repo

view details

Nathan Henrie

commit sha 8cf0c66d097db172e5e90170f09ecd8917b95c65

Merge branch 'master' of github.com:n8henrie/exercism-exercises into master

view details

Nathan Henrie

commit sha 0514703ecdc1002815ff85135d6537a98a3af48c

import progress

view details

push time in 20 days

create barnchn8henrie/exercism-exercises

branch : master

created branch time in 20 days

created repositoryn8henrie/exercism-exercises

created time in 20 days

issue commentn8henrie/fauxmo

Other WeMo devices.

Cool, thanks for the link.

you ever heard of a script/package out there called xml(2|To)dict ,lol ?

While I can manage Python dependencies pretty easily, unfortunately they end up being difficult to deal with for end users, who then need to work about system vs user installs, virtualenvs, conflicting requirements, etc; as a maintainer, I strongly prefer Fauxmo to remain dependency-free.

https://github.com/n8henrie/fauxmo#plugins

Any pre-installed plugins, like the rest of the core Fauxmo code, have no third party dependencies.

mocallins

comment created time in 24 days

issue openedholzschu/a-shell

Can we pass ios shortcuts input as stdin?

I had expected to effectively pipe text from shortcuts into a command (as stdin) and return the output to shortcuts. The stdout seems to be returned (at least in extension mode), but I can't figure out how to pipe in input

For example:

image

I've tried with <<< [Text] using the magic variable and still no luck.

Is this possible?

Thanks in advance, cool project!

created time in a month

issue commentn8henrie/fauxmo

Other WeMo devices.

I am not, since I don't have any relevant devices, so I am both not particularly motivated and moreover would be unable to ensure my implementation worked.

Do you have a link to a reference implementation I could check out? If it fits neatly into the codebase and the contributor were interesting in helping maintain the relevant code going forward, I would accept a PR.

mocallins

comment created time in a month

issue closedn8henrie/node-rcswitch-gpiomem

Can't build RCSwitch on Node>v11

This is due to the removal of V8 functions Int32Value, Uint32Value, GetFunction, etc. Latest node is now v13.2.0. This post discusses a possible solution at least for the value types.

closed time in a month

jdtsmith

issue commentn8henrie/node-rcswitch-gpiomem

Can't build RCSwitch on Node>v11

As noted, I don't know much javascript, and since I'm not using this library, haven't updated the code in >=4y, and have not seen any volunteer contributions to help address it, I think it's reasonable to archive the repo. Please get in touch if anyone would like to contribute a fix, or please feel free to fork.

jdtsmith

comment created time in a month

issue closedn8henrie/fastcli

Upload testing & API

Hi there,

It'd be absolutely amazing if this was made more modular (an API) so that it could be called from within other programs to determine the results.

Further, it would be awesome if this tested the upload speed as well as the download speed, much like the actual fast.com site does.

closed time in a month

MattIPv4

Pull request review commentfail2ban/fail2ban

Add a note about `journalflags` options to `systemd-journal` backend

 def format_help(self, *args, **kwargs): LOG:     string                  a string representing a log line     filename                path to a log file (/var/log/auth.log)-    "systemd-journal"       search systemd journal (systemd-python required)+    "systemd-journal"       search systemd journal. Optionally specify+                            `systemd-journal[journalflags=X]` to determine

Thanks for the feedback, see what you think.

n8henrie

comment created time in a month

push eventn8henrie/fail2ban

Nathan Henrie

commit sha 1b7cd75cc15c7f86f63f9c419de82b1b18291e0b

Add a note about `journalflags` options to `systemd-journal` backend Also adds systemd backend configuration examples to jail.conf(5) Closes #2696

view details

push time in a month

issue closedn8henrie/fauxmo

Support for Household profiles

  • Issues not following the template may be closed for that reason alone.
  • Operating system and version: Raspbian Buster
  • Python version: Python 3.7.3
  • Fauxmo version (fauxmo --version): v0.5.0
  • Echo device type (e.g. Echo, Echo Plus, Dot): Echo
  • [Echo Firmware Version]: 653619520

My Issue

I appear to have a problem with fauxmo when using a) additional Alexa household profiles b) 2 separate amazon alexa accounts. When using a different profile or account to the one I originally set up the devices with, Echo (or alexa app) does not detect devices configured.

In my profile, fauxmo devices remain correctly detected and controlled. In the other adult profile in my household, the fauxmo devices are not detected or controlled. I also have wemo devices, these are correctly detected across profiles and accounts.

I am using the mqtt plugin to connect to two sonoff switches, flashed with homie firmware

WHYT

  • control using IOS Alexa App or Echo - same issues
  • running fauxmo as a service or from command line
  • logging into my profile, or resetting the echo device to be registered to my profile is consistently successful in connecting to and controlling fauxmo devices.

My conclusion is that fauxmo is not allowing additional profiles or accounts to detect and control devices.

If there is a specific message or event I should seek out in the debug log, I can do so.


Please make sure you've taken these steps before submitting a new issue:

  • [ ] Try to reproduce the issue with Fauxmo installed in a venv
  • [Y] Ensure you're running a supported version of Python Requires Python >= 3.6.0 for Fauxmo >= 0.4.0
  • [Y] Run Fauxmo in debug mode (-vvv) and include relevant output
  • [Y] Include your Fauxmo config.json
  • [Y] Search the existing (including closed) issues
    "FAUXMO": {
        "ip_address": "auto"
    },
    "PLUGINS": {
        "MQTTPlugin": {
            "path": "/home/pi/fauxmo/plugins/mqttplugin.py",
            "DEVICES": [
                {
                    "port": 12349,
                    "on_cmd": [ "homie/sonoff-a/switch/on/set", "true" ],
                    "off_cmd": [ "homie/sonoff-a/switch/on/set", "false" ],
                    "state_cmd": "homie/sonoff-a/switch/on/set",
                    "name":"Bedside Lamp",
                    "mqtt_server": "192.168.0.115",
                    "mqtt_port": 1883
                },
                {
                    "port": 12350,
                    "on_cmd": [ "homie/sonoff-3/switch/on/set", "true" ],
                    "off_cmd": [ "homie/sonoff-3/switch/on/set", "false" ],
                    "state_cmd": "homie/sonoff-3/switch/on/set",
                    "name":"Side Lamps",
                    "mqtt_server": "192.168.0.115",
                    "mqtt_port": 1883
                }
            ]
        }
    }
}

closed time in a month

nickbalch

PR opened fail2ban/fail2ban

Add a note about `journalflags` options to `systemd-journal` backend

Minor documentation addition. Closes #2696

Before submitting your PR, please review the following checklist:

  • [ ] CHOOSE CORRECT BRANCH: if filing a bugfix/enhancement against certain release version, choose 0.9, 0.10 or 0.11 branch, for dev-edition use master branch
  • [ ] CONSIDER adding a unit test if your PR resolves an issue
  • [X] LIST ISSUES this PR resolves
  • [ ] MAKE SURE this PR doesn't break existing tests
  • [ ] KEEP PR small so it could be easily reviewed.
  • [ ] AVOID making unnecessary stylistic changes in unrelated code
  • [ ] ACCOMPANY each new failregex for filter X with sample log lines within fail2ban/tests/files/logs/X file
+8 -4

0 comment

2 changed files

pr created time in a month

push eventn8henrie/fail2ban

Nathan Henrie

commit sha 2acb73caf6553d13adcb7b3ada244f3b0734c608

Add a note about `journalflags` options to `systemd-journal` backend Closes #2696

view details

push time in a month

IssuesEvent

fork n8henrie/fail2ban

Daemon to ban hosts that cause multiple authentication errors

http://www.fail2ban.org

fork in a month

push eventn8henrie/n8henrie

Nathan Henrie

commit sha d069f5e8291121c4c248c6e0af258271b5380bc5

Initial commit

view details

push time in a month

create barnchn8henrie/n8henrie

branch : master

created branch time in a month

created repositoryn8henrie/n8henrie

My GitHub profile

created time in a month

push eventn8henrie/n8henrie.github.io

Nathan Henrie

commit sha 3e4c608481ba11bd41d54202ab2a4e7eba1988ed

Update deprecated key

view details

Nathan Henrie

commit sha b08317c5001b7f1e4e5b58d99e40ed7a24fd7817

Add a layout for jupyter notebooks

view details

Nathan Henrie

commit sha 8951995e27fb9339c545ba22f8ad0b4f3aed7d33

First jupyter notebook post

view details

push time in a month

issue closedn8henrie/fauxmo

Alexa unable to find any device

  • Issues not following the template may be closed for that reason alone.
  • Operating system and version: "Raspbian GNU/Linux 10 (buster)"
  • Python version: Python 3.7.3
  • Fauxmo version (fauxmo --version): v0.5.0
  • Echo device type (e.g. Echo, Echo Plus, Dot): Alexa Echo Show
  • Echo Firmware Version:

My Issue

If asked alexa to discover local devices, then it is unable to find any device.

WHYT

  • I started fauxmo running in debug mode to see the communication or any kind of error, however unable to find any issue. I also used the config of my friend, who is running fauxmo sucessfully, but also no success.
  • control using IOS Alexa App or Echo - same issues
  • running fauxmo as a service or from command line
  • logging into my profile, or resetting the echo device to be registered to my profile is consistently successful in connecting to and controlling fauxmo devices.

Please see attached debug output, I can see the communication of my SONOS speakers. If I asked alexa to discover a new devices, I could not see any request from network.

Echo device using the same network as my raspberry pi.

MY CONFIG

{
    "FAUXMO": {
        "ip_address": "192.168.1.49"
    },
    "PLUGINS": {
        "SimpleHTTPPlugin": {
            "DEVICES": [
                {
                    "port": 12340,
                    "on_cmd": "http://192.168.1.53/?cmd=on&id=1",
                    "off_cmd": "http://192.168.1.53/?cmd=off&id=1",
                    "method": "GET",
                    "name": "livingroom light one"
                },
		{
                    "port": 12341,
                    "on_cmd": "http://192.168.1.53/?cmd=on&id=2",
                    "off_cmd": "http://192.168.1.53/?cmd=off&id=2",
                    "method": "GET",
                    "name": "livingroom light two"
                },
		{
                    "port": 12342,
                    "on_cmd": "http://192.168.1.53/?cmd=on&id=3",
                    "off_cmd": "http://192.168.1.53/?cmd=off&id=3",
                    "method": "GET",
                    "name": "livingroom light three"
                },
                {
                    "port": 12343,
                    "on_cmd": "http://192.168.1.53/?cmd=on&id=4",
                    "off_cmd": "http://192.168.1.53/?cmd=off&id=4",
                    "method": "GET",
                    "name": "kitchen light one"
                },
		{
                    "port": 12344,
                    "on_cmd": "http://192.168.1.53/?cmd=on&id=5",
                    "off_cmd": "http://192.168.1.53/?cmd=off&id=5",
                    "method": "GET",
                    "name": "kitchen light two"
                },
                {
                    "port": 12345,
                    "on_cmd": "http://192.168.1.53/?cmd=on&id=6",
                    "off_cmd": "http://192.168.1.53/?cmd=off&id=6",
                    "method": "GET",
                    "name": "fireplace light"
                },
		{
                    "port": 12346,
                    "on_cmd": "http://192.168.1.53/?cmd=on&id=7",
                    "off_cmd": "http://192.168.1.53/?cmd=off&id=7",
                    "method": "GET",
                    "name": "garden light"
                }
            ]
        }
    }
}

DEBUG OUTPUT

root@raspberrypi:~# fauxmo -c /etc/fauxmo/config.json -vvv
2020-07-20 09:01:59 fauxmo:42       INFO     Fauxmo v0.5.0
2020-07-20 09:01:59 fauxmo:43       DEBUG    3.7.3 (default, Dec 20 2019, 18:57:59) 
[GCC 8.3.0]
2020-07-20 09:01:59 fauxmo:40       DEBUG    Using IP address: 192.168.1.49
2020-07-20 09:01:59 fauxmo:112      DEBUG    plugin_vars: {}
2020-07-20 09:01:59 fauxmo:115      DEBUG    device config: {'port': 12340, 'on_cmd': 'http://192.168.1.53/?cmd=on&id=1', 'off_cmd': 'http://192.168.1.53/?cmd=off&id=1', 'method': 'GET', 'name': 'livingroom light one'}
2020-07-20 09:01:59 asyncio:1403     INFO     <Server sockets=[<socket.socket fd=7, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('192.168.1.49', 12340)>]> is serving
2020-07-20 09:01:59 fauxmo:134      DEBUG    Started fauxmo device: {'name': 'livingroom light one', 'plugin': <fauxmo.plugins.simplehttpplugin.SimpleHTTPPlugin object at 0xb5efa090>}
2020-07-20 09:01:59 fauxmo:115      DEBUG    device config: {'port': 12341, 'on_cmd': 'http://192.168.1.53/?cmd=on&id=2', 'off_cmd': 'http://192.168.1.53/?cmd=off&id=2', 'method': 'GET', 'name': 'livingroom light two'}
2020-07-20 09:01:59 asyncio:1403     INFO     <Server sockets=[<socket.socket fd=8, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('192.168.1.49', 12341)>]> is serving
2020-07-20 09:01:59 fauxmo:134      DEBUG    Started fauxmo device: {'name': 'livingroom light two', 'plugin': <fauxmo.plugins.simplehttpplugin.SimpleHTTPPlugin object at 0xb5ef3bb0>}
2020-07-20 09:01:59 fauxmo:115      DEBUG    device config: {'port': 12342, 'on_cmd': 'http://192.168.1.53/?cmd=on&id=3', 'off_cmd': 'http://192.168.1.53/?cmd=off&id=3', 'method': 'GET', 'name': 'livingroom light three'}
2020-07-20 09:01:59 asyncio:1403     INFO     <Server sockets=[<socket.socket fd=9, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('192.168.1.49', 12342)>]> is serving
2020-07-20 09:01:59 fauxmo:134      DEBUG    Started fauxmo device: {'name': 'livingroom light three', 'plugin': <fauxmo.plugins.simplehttpplugin.SimpleHTTPPlugin object at 0xb5e380b0>}
2020-07-20 09:01:59 fauxmo:115      DEBUG    device config: {'port': 12343, 'on_cmd': 'http://192.168.1.53/?cmd=on&id=4', 'off_cmd': 'http://192.168.1.53/?cmd=off&id=4', 'method': 'GET', 'name': 'kitchen light one'}
2020-07-20 09:01:59 asyncio:1403     INFO     <Server sockets=[<socket.socket fd=10, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('192.168.1.49', 12343)>]> is serving
2020-07-20 09:01:59 fauxmo:134      DEBUG    Started fauxmo device: {'name': 'kitchen light one', 'plugin': <fauxmo.plugins.simplehttpplugin.SimpleHTTPPlugin object at 0xb5efa490>}
2020-07-20 09:01:59 fauxmo:115      DEBUG    device config: {'port': 12344, 'on_cmd': 'http://192.168.1.53/?cmd=on&id=5', 'off_cmd': 'http://192.168.1.53/?cmd=off&id=5', 'method': 'GET', 'name': 'kitchen light two'}
2020-07-20 09:01:59 asyncio:1403     INFO     <Server sockets=[<socket.socket fd=11, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('192.168.1.49', 12344)>]> is serving
2020-07-20 09:01:59 fauxmo:134      DEBUG    Started fauxmo device: {'name': 'kitchen light two', 'plugin': <fauxmo.plugins.simplehttpplugin.SimpleHTTPPlugin object at 0xb5e38650>}
2020-07-20 09:01:59 fauxmo:115      DEBUG    device config: {'port': 12345, 'on_cmd': 'http://192.168.1.53/?cmd=on&id=6', 'off_cmd': 'http://192.168.1.53/?cmd=off&id=6', 'method': 'GET', 'name': 'fireplace light'}
2020-07-20 09:01:59 asyncio:1403     INFO     <Server sockets=[<socket.socket fd=12, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('192.168.1.49', 12345)>]> is serving
2020-07-20 09:01:59 fauxmo:134      DEBUG    Started fauxmo device: {'name': 'fireplace light', 'plugin': <fauxmo.plugins.simplehttpplugin.SimpleHTTPPlugin object at 0xb5d8e070>}
2020-07-20 09:01:59 fauxmo:115      DEBUG    device config: {'port': 12346, 'on_cmd': 'http://192.168.1.53/?cmd=on&id=7', 'off_cmd': 'http://192.168.1.53/?cmd=off&id=7', 'method': 'GET', 'name': 'garden light'}
2020-07-20 09:01:59 asyncio:1403     INFO     <Server sockets=[<socket.socket fd=13, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('192.168.1.49', 12346)>]> is serving
2020-07-20 09:01:59 fauxmo:134      DEBUG    Started fauxmo device: {'name': 'garden light', 'plugin': <fauxmo.plugins.simplehttpplugin.SimpleHTTPPlugin object at 0xb5d8e250>}
2020-07-20 09:01:59 fauxmo:136      INFO     Starting UDP server
2020-07-20 09:01:59 asyncio:1259     DEBUG    Datagram endpoint remote_addr=None created: (<_SelectorDatagramTransport fd=14 read=idle write=<idle, bufsize=0>>, <fauxmo.protocols.SSDPServer object at 0xb5efa470>)
2020-07-20 09:02:04 asyncio:1729     INFO     poll took 4254.054 ms: 1 events
2020-07-20 09:02:04 fauxmo:344      DEBUG    Received data below from ('192.168.1.46', 46763):
2020-07-20 09:02:04 fauxmo:345      DEBUG    NOTIFY * HTTP/1.1
HOST: 239.255.255.250:1900
CACHE-CONTROL: max-age = 1800
LOCATION: http://192.168.1.46:1400/xml/device_description.xml
NT: uuid:RINCON_7828CAEC539001400
NTS: ssdp:alive
SERVER: Linux UPnP/1.0 Sonos/58.1-78090 (ZPS18)
USN: uuid:RINCON_7828CAEC539001400
X-RINCON-HOUSEHOLD: Sonos_B9qOZJfLPsWvombgC7eI2oRqkF
X-RINCON-BOOTSEQ: 11
BOOTID.UPNP.ORG: 11
X-RINCON-WIFIMODE: 1
X-RINCON-VARIANT: 1
HOUSEHOLD.SMARTSPEAKER.AUDIO: Sonos_B9qOZJfLPsWvombgC7eI2oRqkF.FaBTzrWj1c91dpcbUgcF


2020-07-20 09:02:04 asyncio:1729     DEBUG    poll took 24.642 ms: 1 events
2020-07-20 09:02:04 fauxmo:344      DEBUG    Received data below from ('192.168.1.44', 40973):
2020-07-20 09:02:04 fauxmo:345      DEBUG    NOTIFY * HTTP/1.1
HOST: 239.255.255.250:1900
CACHE-CONTROL: max-age = 1800
LOCATION: http://192.168.1.44:1400/xml/device_description.xml
NT: uuid:RINCON_347E5C74218901400
NTS: ssdp:alive
SERVER: Linux UPnP/1.0 Sonos/58.1-78090 (ZPS9)
USN: uuid:RINCON_347E5C74218901400
X-RINCON-HOUSEHOLD: Sonos_B9qOZJfLPsWvombgC7eI2oRqkF
X-RINCON-BOOTSEQ: 82
BOOTID.UPNP.ORG: 82
X-RINCON-WIFIMODE: 1
X-RINCON-VARIANT: 2
HOUSEHOLD.SMARTSPEAKER.AUDIO: Sonos_B9qOZJfLPsWvombgC7eI2oRqkF.FaBTzrWj1c91dpcbUgcF


2020-07-20 09:02:04 asyncio:1729     DEBUG    poll took 224.417 ms: 1 events
2020-07-20 09:02:04 fauxmo:344      DEBUG    Received data below from ('192.168.1.46', 46763):
2020-07-20 09:02:04 fauxmo:345      DEBUG    NOTIFY * HTTP/1.1
HOST: 239.255.255.250:1900
CACHE-CONTROL: max-age = 1800
LOCATION: http://192.168.1.46:1400/xml/device_description.xml
NT: urn:schemas-upnp-org:device:ZonePlayer:1
NTS: ssdp:alive
SERVER: Linux UPnP/1.0 Sonos/58.1-78090 (ZPS18)
USN: uuid:RINCON_7828CAEC539001400::urn:schemas-upnp-org:device:ZonePlayer:1
X-RINCON-HOUSEHOLD: Sonos_B9qOZJfLPsWvombgC7eI2oRqkF
X-RINCON-BOOTSEQ: 11
BOOTID.UPNP.ORG: 11
X-RINCON-WIFIMODE: 1
X-RINCON-VARIANT: 1
HOUSEHOLD.SMARTSPEAKER.AUDIO: Sonos_B9qOZJfLPsWvombgC7eI2oRqkF.FaBTzrWj1c91dpcbUgcF


2020-07-20 09:02:04 asyncio:1729     DEBUG    poll took 20.282 ms: 1 events
2020-07-20 09:02:04 fauxmo:344      DEBUG    Received data below from ('192.168.1.44', 40973):
2020-07-20 09:02:04 fauxmo:345      DEBUG    NOTIFY * HTTP/1.1
HOST: 239.255.255.250:1900
CACHE-CONTROL: max-age = 1800
LOCATION: http://192.168.1.44:1400/xml/device_description.xml
NT: urn:schemas-upnp-org:device:ZonePlayer:1
NTS: ssdp:alive
SERVER: Linux UPnP/1.0 Sonos/58.1-78090 (ZPS9)
USN: uuid:RINCON_347E5C74218901400::urn:schemas-upnp-org:device:ZonePlayer:1
X-RINCON-HOUSEHOLD: Sonos_B9qOZJfLPsWvombgC7eI2oRqkF
X-RINCON-BOOTSEQ: 82
BOOTID.UPNP.ORG: 82
X-RINCON-WIFIMODE: 1
X-RINCON-VARIANT: 2
HOUSEHOLD.SMARTSPEAKER.AUDIO: Sonos_B9qOZJfLPsWvombgC7eI2oRqkF.FaBTzrWj1c91dpcbUgcF

closed time in 2 months

kovi44

issue commentn8henrie/fauxmo

Alexa unable to find any device

I would not have figured that out. Great work and thanks for sharing the solution!

kovi44

comment created time in 2 months

PublicEvent

push eventn8henrie/cleanup-history-rs

Nathan Henrie

commit sha 90fc828b4b588603c789bbadd7f68a4b1e2ac097

Fix table

view details

push time in 2 months

push eventn8henrie/cleanup-history-rs

Nathan Henrie

commit sha 4653d05ec510efc26e5b79cfb3956fd59fb6543a

Add crates.io link

view details

push time in 2 months

create barnchn8henrie/cleanup-history-rs

branch : master

created branch time in 2 months

issue closeddense-analysis/ale

rust-analyzer not working properly after 2020-07-06

Information

VIM version

NVIM v0.4.3 Build type: Release

VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Jul 19 2020 20:11:11) macOS version Included patches: 1-1250 Compiled by Homebrew

Operating System: MacOS 10.15.6

What went wrong

My previously working rust-analyzer setup doesn't work properly. 2020-07-06 and earlier are okay, 2020-07-13 and 2020-07-30 are problematic. rust-analyzer releases

For example, with the following invalid rust code, all of the above listed versions properly note the absence of a closing curly brace and flag it:

fn foo() -> () {
    4

However, with the closing brace added, it is still invalid (due to incorrect return type); in ALE, this is properly flagged by rust-analyzer as an error in 2020-07-06 and earlier, but not in the most recent two releases. In VSCode, it is properly flagged as an error by all of these, suggesting a problem relevant to ALE.

fn foo() -> () {
    4
}

Reproducing the bug

$ cargo init foo
$ cd foo
$ cat <<'EOF' > src/main.rs
fn foo() -> () {
4
}
EOF
$ PATH=~/.local/bin/ra-2020-07-13/:"$PATH" nvim src/main.rs
$ # compare with
$ PATH=~/.local/bin/ra-2020-07-06/:"$PATH" nvim src/main.rs

:ALEInfo

 Current Filetype: rust
Available Linters: ['analyzer', 'cargo', 'rls', 'rustc']
  Enabled Linters: ['analyzer']
 Suggested Fixers: 
  'remove_trailing_lines' - Remove all blank lines at the end of a file.
  'rustfmt' - Fix Rust files with Rustfmt.
  'trim_whitespace' - Remove all trailing whitespace characters at the end of every line.
 Linter Variables:

let g:ale_rust_analyzer_config = {}
let g:ale_rust_analyzer_executable = 'rust-analyzer'
 Global Variables:

let g:ale_cache_executable_check_failures = v:null
let g:ale_change_sign_column_color = 0
let g:ale_command_wrapper = ''
let g:ale_completion_delay = 100
let g:ale_completion_enabled = 1
let g:ale_completion_max_suggestions = 50
let g:ale_echo_cursor = 1
let g:ale_echo_msg_error_str = 'Error'
let g:ale_echo_msg_format = '[%linter%] %severity% %s'
let g:ale_echo_msg_info_str = 'Info'
let g:ale_echo_msg_warning_str = 'Warning'
let g:ale_enabled = 1
let g:ale_fix_on_save = 1
let g:ale_fixers = {'*': ['remove_trailing_lines', 'trim_whitespace']}
let b:ale_fixers = ['remove_trailing_lines', 'trim_whitespace', 'rustfmt']
let g:ale_history_enabled = 1
let g:ale_history_log_output = 1
let g:ale_keep_list_window_open = 0
let g:ale_lint_delay = 200
let g:ale_lint_on_enter = 1
let g:ale_lint_on_filetype_changed = 1
let g:ale_lint_on_insert_leave = 1
let g:ale_lint_on_save = 1
let g:ale_lint_on_text_changed = 'normal'
let g:ale_linter_aliases = {}
let g:ale_linters = {}
let b:ale_linters = ['analyzer']
let g:ale_linters_explicit = 0
let g:ale_list_vertical = 0
let g:ale_list_window_size = 10
let g:ale_loclist_msg_format = '[%linter%] %severity% %s'
let g:ale_lsp_root = {}
let g:ale_max_buffer_history_size = 20
let g:ale_max_signs = -1
let g:ale_maximum_file_size = v:null
let g:ale_open_list = 0
let g:ale_pattern_options = v:null
let g:ale_pattern_options_enabled = v:null
let g:ale_set_balloons = 0
let g:ale_set_highlights = 1
let g:ale_set_loclist = 1
let g:ale_set_quickfix = 0
let g:ale_set_signs = 1
let g:ale_sign_column_always = 0
let g:ale_sign_error = '>>'
let g:ale_sign_info = '--'
let g:ale_sign_offset = 1000000
let g:ale_sign_style_error = '>>'
let g:ale_sign_style_warning = '--'
let g:ale_sign_warning = '--'
let g:ale_sign_highlight_linenrs = 0
let g:ale_statusline_format = v:null
let g:ale_type_map = {}
let g:ale_use_global_executables = v:null
let g:ale_virtualtext_cursor = 0
let g:ale_warn_about_trailing_blank_lines = 1
let g:ale_warn_about_trailing_whitespace = 1
  Command History:

(executable check - success) rust-analyzer
(started) ['/usr/local/bin/bash', '-c', '''rust-analyzer''']

closed time in 2 months

n8henrie

issue commentdense-analysis/ale

rust-analyzer not working properly after 2020-07-06

Also able to reproduce the bug on my Linux machine. However, looks like it's a rust-analyzer bug and not a ALE bug, and has already been fixed upstream.

Running a couple bisects on rust-analyzer:

Introduced bug: 17edf50e2c8ce92a6f056e311d68000d64838873 Last bad: adc4bb540 Fixed bug: a32dd9c478fec0c21fa7416c267bdf1d2416b355

n8henrie

comment created time in 2 months

issue openeddense-analysis/ale

rust-analyzer not working properly after

Information

VIM version

NVIM v0.4.3 Build type: Release

VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Jul 19 2020 20:11:11) macOS version Included patches: 1-1250 Compiled by Homebrew

Operating System: MacOS 10.15.6

What went wrong

My previously working rust-analyzer setup doesn't work properly. 2020-07-06 and earlier are okay, 2020-07-13 and 2020-07-30 are problematic. rust-analyzer releases

For example, with the following invalid rust code, all of the above listed versions properly note the absence of a closing curly brace and flag it:

fn foo() -> () {
    4

However, with the closing brace added, it is still invalid (due to incorrect return type); in ALE, this is properly flagged by rust-analyzer as an error in 2020-07-06 and earlier, but not in the most recent two releases. In VSCode, it is properly flagged as an error by all of these, suggesting a problem relevant to ALE.

fn foo() -> () {
    4
}

Reproducing the bug

$ cargo init foo
$ cd foo
$ cat <<'EOF' > src/main.rs
fn foo() -> () {
4
}
EOF
$ PATH=~/.local/bin/ra-2020-07-13/:"$PATH" nvim src/main.rs
$ # compare with
$ PATH=~/.local/bin/ra-2020-07-06/:"$PATH" nvim src/main.rs

:ALEInfo

 Current Filetype: rust
Available Linters: ['analyzer', 'cargo', 'rls', 'rustc']
  Enabled Linters: ['analyzer']
 Suggested Fixers: 
  'remove_trailing_lines' - Remove all blank lines at the end of a file.
  'rustfmt' - Fix Rust files with Rustfmt.
  'trim_whitespace' - Remove all trailing whitespace characters at the end of every line.
 Linter Variables:

let g:ale_rust_analyzer_config = {}
let g:ale_rust_analyzer_executable = 'rust-analyzer'
 Global Variables:

let g:ale_cache_executable_check_failures = v:null
let g:ale_change_sign_column_color = 0
let g:ale_command_wrapper = ''
let g:ale_completion_delay = 100
let g:ale_completion_enabled = 1
let g:ale_completion_max_suggestions = 50
let g:ale_echo_cursor = 1
let g:ale_echo_msg_error_str = 'Error'
let g:ale_echo_msg_format = '[%linter%] %severity% %s'
let g:ale_echo_msg_info_str = 'Info'
let g:ale_echo_msg_warning_str = 'Warning'
let g:ale_enabled = 1
let g:ale_fix_on_save = 1
let g:ale_fixers = {'*': ['remove_trailing_lines', 'trim_whitespace']}
let b:ale_fixers = ['remove_trailing_lines', 'trim_whitespace', 'rustfmt']
let g:ale_history_enabled = 1
let g:ale_history_log_output = 1
let g:ale_keep_list_window_open = 0
let g:ale_lint_delay = 200
let g:ale_lint_on_enter = 1
let g:ale_lint_on_filetype_changed = 1
let g:ale_lint_on_insert_leave = 1
let g:ale_lint_on_save = 1
let g:ale_lint_on_text_changed = 'normal'
let g:ale_linter_aliases = {}
let g:ale_linters = {}
let b:ale_linters = ['analyzer']
let g:ale_linters_explicit = 0
let g:ale_list_vertical = 0
let g:ale_list_window_size = 10
let g:ale_loclist_msg_format = '[%linter%] %severity% %s'
let g:ale_lsp_root = {}
let g:ale_max_buffer_history_size = 20
let g:ale_max_signs = -1
let g:ale_maximum_file_size = v:null
let g:ale_open_list = 0
let g:ale_pattern_options = v:null
let g:ale_pattern_options_enabled = v:null
let g:ale_set_balloons = 0
let g:ale_set_highlights = 1
let g:ale_set_loclist = 1
let g:ale_set_quickfix = 0
let g:ale_set_signs = 1
let g:ale_sign_column_always = 0
let g:ale_sign_error = '>>'
let g:ale_sign_info = '--'
let g:ale_sign_offset = 1000000
let g:ale_sign_style_error = '>>'
let g:ale_sign_style_warning = '--'
let g:ale_sign_warning = '--'
let g:ale_sign_highlight_linenrs = 0
let g:ale_statusline_format = v:null
let g:ale_type_map = {}
let g:ale_use_global_executables = v:null
let g:ale_virtualtext_cursor = 0
let g:ale_warn_about_trailing_blank_lines = 1
let g:ale_warn_about_trailing_whitespace = 1
  Command History:

(executable check - success) rust-analyzer
(started) ['/usr/local/bin/bash', '-c', '''rust-analyzer''']

created time in 2 months

issue commentn8henrie/fauxmo

Alexa unable to find any device

Huh, this is an odd one.

there si no network limitation like firewall

This conflicts with your earlier statement:

I added my firewall rules

Yes, I think you're likely right that it's not the firewall. But my comment was this was the first thing that I would try; it is certainly possible to have firewall rules that restrict traffic coming to or from a specific host, so the fact that your sonos can broadcast doesn't necessarily rule this out, though it does make it less likely.

My next guess would be that it could be related to the Echo Show. I don't have one of these to test with, and I'm not sure whether I've had others use Fauxmo with a Show. Fauxmo has failed to work with some Alexa devices in the past, such as the wand as well as the webapp. Do you have another Echo device to test with?

Can you ping the Echo from your Raspberry Pi? If so, have you looked through the example tcpdump commands to see if there are any broadcasts coming from the Echo when you discover devices?

If not, there's not a whole lot that can be done on my end.

If so, please post and perhaps Fauxmo can be reconfigured to recognize whatever it is doing differently.

kovi44

comment created time in 2 months

issue commentn8henrie/fauxmo

Alexa unable to find any device

Odd.

I'm far from a firewall expert, but the first thing I would try is temporarily disabling your firewall to see if that changes anything.

Also, I assume you've triple checked the static IP address you're using?

kovi44

comment created time in 2 months

issue commentn8henrie/fauxmo

Alexa unable to find any device

Thanks for the complete issue report!

Can you elaborate on this:

logging into my profile, or resetting the echo device to be registered to my profile is consistently successful in connecting to and controlling fauxmo devices.

So are you trying to get it to work without being logged into an account? Please go into more detail about the circumstances under which you are getting it to work, and how that's difference from what you're hoping to achieve.

Also, it looks like the log was only running for 5 seconds -- I presume you are running it for longer but truncated because there is nothing else to see?

Any firewall running on the device running Fauxmo?

kovi44

comment created time in 2 months

issue commentn8henrie/pycookiecheat

Empty response

You're right, it looks like the code path now checks for Chrome before Chromium -- on one hand I'd prefer to switch this back to stay consistent with the docs (and to make the open source project the "easier" path), but on the other hand this might break existing functionality. I will probably just update the docs to note that it looks for Chrome, then Chromium.

I'm not familiar with secret-tool -- thanks for the info.

jmspaggi

comment created time in 2 months

issue commentn8henrie/fauxmo

Support for Household profiles

Thanks for the update!

Looks like this is probably an upstream issue: https://www.amazonforum.com/s/question/0D54P00006zSzPQSA0/using-smart-devices-echo-with-multiple-profiles

I will likely close the issue unless it looks like there is something Fauxmo specific here. Thank you for pointing it out and your help with troubleshooting!

BTW, the link in that thread for "more information" is not working for me, at least not on mobile.

nickbalch

comment created time in 2 months

issue commentn8henrie/fauxmo

Support for Household profiles

Just wanted to note that I haven't forgotten this issue. I tested on my wife's iPhone and confirm it does not pick up new devices in her Alexa app; when I change nothing but subsequently run "discover devices" on my phone they are discovered. I'm not sure why. Will continue to investigate.

nickbalch

comment created time in 2 months

starteddevlpr/mpptCommander

started time in 2 months

startedKyleJamesWalker/renogy_rover

started time in 2 months

startedxxv/tracer

started time in 2 months

startedmenloparkinnovation/renogy-rover

started time in 2 months

issue commentct-Open-Source/tuya-convert

[Solved] Aoyococr X10S bricked (when trying to flash from Docker on unsupported OS)

Just wanted to give a little update -- I got these switches set up with HomeAssistant <- MQTT -> Tasmota and noted that the power utilization reporting does indeed work (although I had to configure the reporting interval to be much more frequent for my use case). I found a template that works well for me:

{"NAME":"Aoycocr X10S","GPIO":[56,0,57,0,21,134,0,0,131,17,132,0,0],"FLAG":0,"BASE":45}

Especially given that the small form factor only takes up 1 outlet, it's rated for 15A, and they're only around $8 each, I figured it was worth loading up on another 4 before the firmware changes.

Of the second set, the first flashed fine, with the exception of the backup failing (like all the others). I decided to comment out the backup part of the script, and the 2nd and 3rd both subsequently did not complete the process on the first go. I don't know if this was due to me commenting out the backup or just random. I was able to get both of these to complete the process on a second go; it was able to locate the intermediate firmware and complete the process without a hitch. I then restored the backup part of the script (thinking that may have been the culprit -- timing issue?), but the 4th plug failed to flash and was subsequently unable to recover the process. I tried literally hundreds of variations of unplugging and re-plugging, with or without clicking or holding the button, before, after, and during the setup of the vtrust-flash AP, toggling the power a few times quickly, letting it sit powered for hours before trying, letting it sit unpowered overnight before trying... absolutely nothing.

This morning I took it apart. This time I was able to hook into the middle prong of the voltage regulator with a small probe and used my multimeter to locate a large blob of grounded solder that I grabbed with an alligator clip, so I didn't need to solder. It still did not work in spite of multiple tries without the capacitor. I again attached a 200uF bypass capacitor, and it instantly worked.

Connected back up minding the jumper, updated Tasmota and made sure everything worked, then applied a little superglue.

So after 8 switches, my experience with the Aoyococr X10S has been:

  • Much of the time tuya-convert works great with minimal effort, although the firmware backup has failed every time
  • About 1/3 of the time there is some kind of issue with the initial flash
    • Of these, about 1/2 of them were resolved by just re-running tuya-convert, or unplugging and replugging and then re-running tuya-convert -- usually this took no more than 1-2 minutes to make obvious progress here
    • The other 1/2 I was unable to get to work without opening the devices and powering the ESP8266 directly, which was not terribly difficult
    • IME, powering the device properly required a bypass capacitor -- I did not get it to work even once without one, and it worked instantly every time with one

Ultimately I have 8/8 switches working great, I'm very pleased. Thank you!

n8henrie

comment created time in 3 months

push eventn8henrie/nb_black

Nathan Henrie

commit sha a6f96bd51f236684266866edf42c3843795ff504

Allow user configurable line length

view details

push time in 3 months

fork n8henrie/nb_black

A simple extension for Jupyter Notebook and Jupyter Lab to beautify Python code automatically using black.

fork in 3 months

issue commentdnanhkhoa/nb_black

Change Black linelength defaults?

Here's one way: https://github.com/arokem/python-matlab-bridge/blob/master/pymatbridge/matlab_magic.py#L68 accept kwargs into load_ipython_extension and allow users desiring custom configuration to manually import the extension and run the function with their config.

The below is just a proof-of-concept patch, I don't use yapf so I don't know if it breaks anything there, and I only implemented configuration for line-length. The screenshot below shows how to load it with config, and shows that if loaded with %load_ext, it successfully loads but will use the black defaults.

diff --git a/lab_black.py b/lab_black.py
index 9dbf6f4..bec76e3 100644
--- a/lab_black.py
+++ b/lab_black.py
@@ -23,10 +23,11 @@ from IPython.display import Javascript, display
 __BF_SIGNATURE__ = "__BF_HIDDEN_VARIABLE_{}__"
 
 if sys.version_info >= (3, 6, 0):
-    from black import format_str, FileMode
+    import black
 
-    def _format_code(code):
-        return format_str(src_contents=code, mode=FileMode())
+    def _format_code(code, mode):
+
+        return black.format_str(src_contents=code, mode=mode)
 
 
 else:
@@ -170,9 +171,10 @@ def _recover_magic_commands(cell, hidden_variables):
 
 
 class BlackFormatter(object):
-    def __init__(self, ip, is_lab):
+    def __init__(self, ip, is_lab, mode):
         self.shell = ip
         self.is_lab = is_lab
+        self.mode = mode
 
     def __set_cell(self, unformatted_cell, cell, cell_id=None):
         if self.is_lab:
@@ -215,7 +217,7 @@ class BlackFormatter(object):
                 # Transform magic commands into special variables
                 cell = _transform_magic_commands(unformatted_cell, hidden_variables)
 
-                formatted_code = _format_code(cell)
+                formatted_code = _format_code(cell, self.mode)
 
                 # Recover magic commands
                 formatted_code = _recover_magic_commands(
@@ -230,10 +232,14 @@ class BlackFormatter(object):
 black_formatter = None
 
 
-def load_ipython_extension(ip):
+def load_ipython_extension(ip, line_length=79):
     global black_formatter
+    mode = black.FileMode(
+        target_versions={black.TargetVersion.PY38}, line_length=line_length,
+    )
+
     if black_formatter is None:
-        black_formatter = BlackFormatter(ip, is_lab=True)
+        black_formatter = BlackFormatter(ip, is_lab=True, mode=mode)
         ip.events.register("post_run_cell", black_formatter.format_cell)

screenshot 2020-06-25 at 12 13 29 PM

coolum001

comment created time in 3 months

issue commentdnanhkhoa/nb_black

Change Black linelength defaults?

I'd also love to see this extension respect pyproject.toml's black settings, but no luck so far.

I've gone the route above and manually edited the file in my site-packages which works.

Looking at the black code, I think the issue is that format_str doesn't call the functions related to finding and loading the config file; it relies on the passed-in FileMode, which has been set to defaults in the extension. Unfortunately I don't see an easy way to import just the config loading code from black (tried by importing click.testing.FileRunner or something to that effect but couldn't sort it out).

coolum001

comment created time in 3 months

issue closedct-Open-Source/tuya-convert

[Solved] Aoyococr X10S bricked (when trying to flash from Docker on unsupported OS)

New to tuya-convert.

I just tried flashing a Aoyococr X10S using docker on a Raspberry Pi 3 running Void Linux. It didn't work. (I know that Void is not a supported platform, this was just an experiment at my own risk and if the plug is bricked because of that so be it. Just wanted to try!)

It got to the backing up firmware phase and seemed like it was working, but afterwards the switch seems almost totally non-functional. It still blinks its light -- sometimes 2 or 3 times -- when I plug it in, but that's it. It doesn't join the vtrust-flash network, and it doesn't create a vtrust-recovery network, so I don't think it got to the intermediate firmware.

Reviewing other issues with this device it looks like I'll have to figure out how to open it up, unless there are any other ideas. If it's not joining vtrust-flash or presenting the recovery network, are there any other steps I should consider before trying to open?

Many thanks in advance for a really cool project!

EDIT: No logs seem to have been generated, either in the directory from which I'm running Docker, or in the directory with tuya-convert.

closed time in 3 months

n8henrie

issue commentct-Open-Source/tuya-convert

[Solved] Aoyococr X10S bricked (when trying to flash from Docker on unsupported OS)

Thanks for your response. Good news, I was able to follow the same process detailed elsewhere to fix the plug, so I have 4/4 running Tasmota now. Very happy to see the power usage reporting works!

I suspect the issue with Void (or at least part of it) may have do to with void using runit instead of systemd; for example, to get the vtrust-flash AP to exist for more than a few seconds I had to first turn off my existing AP with sv; otherwise, runit seemed to restore my default AP mode.

Yes, I disconnected from power and tried numerous iterations of trying to join vtrust-flash, including only powering the plug after the AP was visible and phone was connected as you described, various durations of holding the button powered or unpowered, connecting the plug while holding the button, waiting 30+ minutes, (or even overnight), etc. Could never get it to connect.

Interestingly, even with the soldered connections above and directly powering from 3.3v it still did not work and still would not connect; after a number of attempts I included a bypass capacitor as recommended and it instantly worked.

So my process, start-to-finish:

  1. Carefully open the backside using a box cutter (thanks to @clharting for the tips)
    1. Carefully wedge the blade into the middle of the flat portion of top or bottom until it starts to open a touch with light pressure
    2. Insert a small flathead screwdriver and use this to carefully spread the opening to either side where the tabs are
    3. Repeat for the other flat side
  2. Solder a 30g wire to the center ("output") and one to the ground of the 3.3v regulator (thanks to @skpram219 for the image, very helpful)
    • Just to see, I first tried just using an alligator clip to this output, being careful there were no shorts, and another to the plug's ground, but this didn't work -- I suspect something about AC vs DC grounding?
  3. Connect a 200uF capacitor (just what I had laying around) as a bypass capacitor between these two wires
  4. Start tuya-convert and get the AP ready
  5. Connect (center prong) "output" to 3.3v from a ft232 uart I had laying around, and ground to its ground
  6. Ensure flash succeeded by looking for the tasoma- AP to appear on my phone
  7. Reassemble the plug, ensuring the jumper lines up correctly for the button
  8. Plug into AC power and make sure it still seems to work
  9. Seal up with superglue

Thanks to all for responses. I'll go ahead and close the issue, for now I'd recommend others not use Void unless they are exited about the prospect of opening up the plug. Raspbian worked a treat.

n8henrie

comment created time in 3 months

startedDavid-OConnor/pyflow

started time in 3 months

issue commentct-Open-Source/tuya-convert

Device partially update but seems to be stuck at intermediate firmware: Aoyococr X10S

@clharting @MrPaulAR @skpram219 -- can any of you describe your strategy for opening it up without damaging the unit? I tried going around the seam on the back with a scalpel but that thing is stuck on there tight! Heat gun?

linkages

comment created time in 3 months

issue commentct-Open-Source/tuya-convert

Aoyococr X10S bricked (when trying to flash from Docker on unsupported OS)

Of the 4-pack, the remaining 3 seem to have flashed from Raspbian. There were a few small hiccups -- none of the firmware backups worked, and one of the switches failed partway through but was able to recover on a subsequent run. So it doesn't seem to be a problem with the switches (e.g. a firmware update).

I tried re-running the broken switch under Raspbian but had no such luck (which isn't surprising, since it didn't seem to be joining the network as I described above).

n8henrie

comment created time in 3 months

issue openedct-Open-Source/tuya-convert

Aoyococr X10S bricked (when trying to flash from Docker on unsupported OS)

New to tuya-convert.

I just tried flashing a Aoyococr X10S using docker on a Raspberry Pi 3 running Void Linux. It didn't work. (I know that Void is not a supported platform, this was just an experiment at my own risk and if the plug is bricked because of that so be it. Just wanted to try!)

It got to the backing up firmware phase and seemed like it was working, but afterwards the switch seems almost totally non-functional. It still blinks its light -- sometimes 2 or 3 times -- when I plug it in, but that's it. It doesn't join the vtrust-flash network, and it doesn't create a vtrust-recovery network, so I don't think it got to the intermediate firmware.

Reviewing other issues with this device it looks like I'll have to figure out how to open it up, unless there are any other ideas. If it's not joining vtrust-flash or presenting the recovery network, are there any other steps I should consider before trying to open?

Many thanks in advance for a really cool project!

created time in 3 months

more