Skip to content

Instantly share code, notes, and snippets.

@symbioquine
symbioquine / patch.lua
Last active August 11, 2019 15:40 — forked from alexander-yakushev/patch.lua
Fix move_to_screen in AwesomeWM v4.3
function smart_move_to_screen(c, dir)
local was_maximized = { h = false, v = false }
if c.maximized_horizontal then
c.maximized_horizontal = false
was_maximized.h = true
end
if c.maximized_vertical then
c.maximized_vertical = false
was_maximized.v = true
end
@symbioquine
symbioquine / Readme.md
Last active July 8, 2024 20:15
Understanding the undocumented Epever 0x43 (67) modbus command

Warning: This is all based on what I have inferred through interacting with the Epever Tracer 3210AN {0: b'EPsolar Tech co., Ltd', 1: b'TriRon3210', 2: b'V01.55+V01.22'}. Please treat this repository as informational only and test carefully before assuming any of this will work with your device.

The undocumented Epever 0x43 (67) modbus command is similar to the regular read register command (0x4) except that it allows reading discontinguous registers.

The request format is the same - two big-endian short integers indicating the starting register address and the number of registers to retrieve;

+---------+--------------+------------------------+----------------+-----+
|         |              |                        |                |     |
| unit_id | command=0x43 | start_register_address | register_count | crc |
@symbioquine
symbioquine / gist:3be25b130c57f1108eb7ca9bd055f17e
Created February 14, 2021 02:08
2021_02_13_farmOS_2x_migration_testing_log
$ docker-compose logs --follow www2
Attaching to devel_www2_1
www2_1 | + '[' -d /opt/drupal ']'
www2_1 | ++ ls -A /opt/drupal/composer.json
www2_1 | ls: cannot access '/opt/drupal/composer.json': No such file or directory
www2_1 | + '[' '' ']'
www2_1 | + echo 'farmOS codebase not detected. Copying from pre-built files in the Docker image.'
www2_1 | + cp -rp /var/farmOS/. /opt/drupal
www2_1 | farmOS codebase not detected. Copying from pre-built files in the Docker image.
www2_1 | + wait_db_ready
@symbioquine
symbioquine / gist:ecd83655865ebe631a2ed164b665264f
Created February 14, 2021 04:02
Troubleshooting `farm_migrate_quantity` farmOS 2.x migration
# drush migrate:messages farm_migrate_quantity
[warning] array_keys() expects parameter 1 to be array, null given MigrateToolsCommands.php:626
[warning] array_map(): Expected parameter 2 to be an array, null given MigrateToolsCommands.php:626
[warning] array_combine() expects parameter 1 to be array, null given MigrateToolsCommands.php:627
[notice] No messages for this migration
# drush migrate:status farm_migrate_quantity
------------------------------------------------------- ----------------------- -------- ------- ---------- ------------- ---------------
Group Migration ID Status Total Imported Unprocessed Last Imported
------------------------------------------------------- ----------------------- -------- ------- ---------- ------------- ---------------
farmOS 1.x Quantity Migration (farm_migrate_quantity) farm_migrate_quantity Idle 559 0 559
@symbioquine
symbioquine / LICENSE
Last active April 21, 2022 20:05
Proxying MT50 and Epever Tracer with pymodbus & epsolar_tracer
MIT License
Copyright (c) 2021 symbioquine
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
version: '3'
services:
db:
image: postgres:12
volumes:
- './db:/var/lib/postgresql/data'
ports:
- '5432:5432'
environment:
POSTGRES_USER: farm
@symbioquine
symbioquine / poetry.lock
Created January 17, 2022 21:05
rewrite_fix_big_endian_geometries
[[package]]
name = "attrs"
version = "21.4.0"
description = "Classes Without Boilerplate"
category = "main"
optional = false
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*"
[package.extras]
dev = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins", "zope.interface", "furo", "sphinx", "sphinx-notfound-page", "pre-commit", "cloudpickle"]
@symbioquine
symbioquine / seeding_logs_by_weekday.ipynb
Created February 12, 2022 15:56
farmOS + JupyterLite: seeding_logs_by_weekday.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@symbioquine
symbioquine / animal_csv_import.ipynb
Created February 12, 2022 17:50
farmOS + JupyterLite: Import a CSV of Animals
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@symbioquine
symbioquine / land_kml_import.ipynb
Created February 15, 2022 16:52
farmOS + JupyterLite: Import KML
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.