-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
463 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2021 Fawno | ||
|
||
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: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[![GitHub license](https://img.shields.io/github/license/fawno/HiDANCE)](https://github.com/fawno/HiDANCE/blob/master/LICENSE) | ||
[![GitHub release](https://img.shields.io/github/release/fawno/HiDANCE)](https://github.com/fawno/HiDANCE/releases) | ||
[![Packagist](https://img.shields.io/packagist/v/fawno/HiDANCE)](https://packagist.org/packages/fawno/hidance) | ||
[![Packagist Downloads](https://img.shields.io/packagist/dt/fawno/HiDANCE)](https://packagist.org/packages/fawno/hidance/stats) | ||
[![GitHub issues](https://img.shields.io/github/issues/fawno/HiDANCE)](https://github.com/fawno/HiDANCE/issues) | ||
[![GitHub forks](https://img.shields.io/github/forks/fawno/HiDANCE)](https://github.com/fawno/HiDANCE/network) | ||
[![GitHub stars](https://img.shields.io/github/stars/fawno/HiDANCE)](https://github.com/fawno/HiDANCE/stargazers) | ||
[![Documentation](https://img.shields.io/badge/documentation-blue)](docs/documentation.md) | ||
|
||
# HiDANCE E-meters interface in PHP | ||
|
||
Simple interface in PHP to interact with HiDANCE E-meters |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"name": "fawno/hidance", | ||
"description": "HiDANCE E-meters", | ||
"minimum-stability": "dev", | ||
"require": { | ||
"blamebutton/php-serial": "dev-master" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
# HiDANCE J7-H USB Energy Meter | ||
|
||
## Production Description | ||
Measurement Ranges (and resolution accuracy): | ||
- Voltage: 3.60 - 32.0 V (0.01 V) | ||
- Current: 0.00 - 5.00 A (0.01 A) | ||
- Capacity accumulation: 0 - 99999 mAh (0.001 Ah) | ||
- Power accumulation: 0 - 9999.99 Wh (0.01 Wh) | ||
- Power calculation: 0.00 - 160.00 W (0.01 W) | ||
- Impedance: 0.0 - 6000.0 $\Omega$ (0.1 $\Omega$) | ||
- Temperature: 0 - 100 ºC (1 ºC) | ||
- Timing time: 999:59:59 (1 s) | ||
- USB D+ voltage: 0 - 3.30 V (0.01 V) | ||
- USB D- voltage: 0 - 3.30 V (0.01 V) | ||
|
||
## Product Details: | ||
- Input Interface: USB | ||
- Output interface: USB | ||
- Timed charge reminder settings: 24-hour countdown | ||
- Full charge threshold parameters: < 2 W / 0.5 hours | ||
- Refresh time: > 500ms / time | ||
- Measurement rate: about 0.5 time / s | ||
- Alarm mode: siren sound | ||
- Display type: IPS Color Screen | ||
- Product dimensions: 76 x 30.5 x 15.6 mm | ||
- Current consumption: < 0.02 A | ||
- Operating temperature: -10 to +60 ºC | ||
- Working humidity: 10 to 80 (no doubt) | ||
- Work oppression: 80 - 106 Kpa | ||
|
||
## KEY Button Description | ||
1. Long press the key button to flip the screen (180 degree flip) | ||
2. Double-click the capacity(Ah) to clear zero. | ||
3. Three-click the Quantity of electric charge(Wh) is clear zero. | ||
4. Four-click time is clear zero. | ||
5. Five-click timing settings. | ||
|
||
Switch between different display interfaces by clicking the button | ||
|
||
## Software download address: | ||
|
||
[E-meter](http://www.mediafire.com/folder/31bc15uhq8odb/E-meter) | ||
Supports Android phones and IOS phones | ||
|
||
## SDK | ||
|
||
##### Record structure: | ||
|
||
| Offset | Meaning | Scale Unit | Data format | Stored | | ||
|--------|-------------------------|------------|----------------|:------:| | ||
| 0000h | Data mark (0xFF550103) | | char[4] | | | ||
| 0004h | reserved | | char | | | ||
| 0005h | V+ | 1/100 V | unsigned word | | | ||
| 0007h | V- | 1/100 V | unsigned char | | | ||
| 0008h | Current (I) | 1/100 A | unsigned word | | | ||
| 000Ah | reserved | | char | | | ||
| 000Bh | Capacity | 1 mAh | unsigned word | Yes | | ||
| 000Dh | Energy | 1/100 Wh | unsigned dword | Yes | | ||
| 0011h | D- | 1/100 V | unsigned word | | | ||
| 0013h | D+ | 1/100 V | unsigned word | | | ||
| 0015h | Temp | 1 ºC | unsigned word | | | ||
| 0017h | Hours | 1 h | unsigned word | Yes | | ||
| 0019h | Minuts | 1 min | unsigned char | Yes | | ||
| 001Ah | Seconds | 1 s | unsigned char | | | ||
| 001Bh | Back Light (BL) | 1 s | unsigned char | Yes | | ||
| 001Ch | Overvoltage alarm (V>) | 1/100 V | unsigned word | Yes | | ||
| 001Eh | Undervoltage alarm (V<) | 1/100 V | unsigned word | Yes | | ||
| 0020h | Overcurrent alarm (I>) | 1/100 A | unsigned word | Yes | | ||
| 0022h | Power Factor | 1/100 | unsigned char | | | ||
| 0023h | reserved | | char | | | ||
|
||
##### Commands | ||
| Command | Send | Receive | | ||
|----------------|-------------------------------|-------------------------| | ||
| Electric Reset | FF 55 11 03 01 00 00 00 00 51 | FF 55 02 03 01 00 00 42 | | ||
| Capacity Reset | FF 55 11 03 02 00 00 00 00 52 | FF 55 02 03 01 00 00 42 | | ||
| Time Reset | FF 55 11 03 03 00 00 00 00 53 | FF 55 02 03 01 00 00 42 | | ||
| All Reset | FF 55 11 03 05 00 00 00 00 5D | FF 55 02 03 01 00 00 42 | | ||
| Setup | FF 55 11 03 31 00 00 00 00 01 | FF 55 02 03 03 00 00 4C | | ||
| Enter | FF 55 11 03 32 00 00 00 00 02 | FF 55 02 03 03 00 00 4C | | ||
| + | FF 55 11 03 33 00 00 00 00 03 | FF 55 02 03 01 00 00 42 | | ||
| - | FF 55 11 03 34 00 00 00 00 0C | FF 55 02 03 01 00 00 42 | | ||
|
||
|
||
##### Data formats | ||
|
||
| Data format | Lenght | Byte order | | ||
|-------------|--------:|------------| | ||
| char | 8 bits | | | ||
| word | 16 bits | Big endian | | ||
| dword | 32 bits | Big endian | | ||
|
||
## Images | ||
|
||
![](img/001.jpg) | ||
![](img/002.jpg) | ||
![](img/003.jpg) | ||
![](img/004.jpg) | ||
![](img/005.jpg) | ||
![](img/006.jpg) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+117 KB
docs/JDY-16/JDY-16 Master Slave Transparent Transmission Configuration.pdf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Documentation | ||
|
||
#### HiDANCE J7-H USB Energy Meter | ||
- [J7-H User Manual](J7-H/J7-H.md) | ||
|
||
#### JDY-16 High Speed Transparent Transmission Bluetooth Module | ||
- [JDY-16 v1.2 (English manual)](JDY-16%20v1.2%20(English%20manual).pdf) | ||
- [JDY-16 Master/Slave Transparente configuration](JDY-16%20Master%20Slave%20Transparent%20Transmission%20Configuration.pdf) | ||
- [JDY-16 UUID Configuration](JDY-16%20UUID%20Configuration.pdf) | ||
|
||
#### JDY-19 Ultra-low Power Consumption Bluetooth 4.2 BLE Module | ||
- [JDY-19 Bluetooth Module Usage Manual](JDY-19/JDY-19%20Bluetooth%204.2%20BLE%20Module%20(v1.3).pdf) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?php | ||
require __DIR__ . '/../vendor/autoload.php'; | ||
require __DIR__ . '/../src/jdy16.php'; | ||
require __DIR__ . '/../src/j7h.php'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php | ||
require __DIR__ . '/autoload.php'; | ||
|
||
use Fawno\JDY\J7H; | ||
|
||
$data = file_get_contents('data/jdy-20210509-0037.raw'); | ||
$csv = J7H::parse2csv($data, ';', true); | ||
file_put_contents('data/jdy-20210509-0037.csv', $csv); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
require __DIR__ . '/autoload.php'; | ||
|
||
use Fawno\JDY\J7H; | ||
|
||
$jdy = new J7H('COM8'); | ||
|
||
//$filename = strftime('data/jdy-%Y%m%d-%H%M.raw'); | ||
$filename = null; | ||
|
||
//$jdy->read(); | ||
//$jdy->record($filename); | ||
|
||
echo $jdy->parse2csv('', "\t", true); | ||
do { | ||
$data = $jdy->read($filename); | ||
if ($jdy->isData($data)) { | ||
echo $jdy->parse2csv($data, "\t"); | ||
} else { | ||
echo $data; | ||
} | ||
} while (!$jdy->isDisconnectedSignal($data)); | ||
|
Oops, something went wrong.