Skip to content

Commit

Permalink
Merge pull request #8 from arendst/development
Browse files Browse the repository at this point in the history
Update
  • Loading branch information
Jason2866 authored Sep 18, 2019
2 parents 8769dac + f8ea106 commit 3f7b499
Show file tree
Hide file tree
Showing 84 changed files with 3,044 additions and 1,351 deletions.
72 changes: 42 additions & 30 deletions .github/ISSUE_TEMPLATE/Bug_report.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
---
name: Bug report
about: Create a report to help us improve

---

<GUIDE>

<This BUG issue template is meant to REPORT Tasmota software BUGS ONLY>

<Please DO NOT OPEN AN ISSUE:>
<If your Tasmota version is not the latest, please update before posting. Your issue might be already solved. Latest precompiled bins of Tasmota can be downloaded from http://thehackbox.org/tasmota/>
<If your issue is a flashing issue, please address that to the Tasmota Support Chat>
<If your issue is compilation problem, please address that to the Tasmota Support Chat>
<If your issue has been addresed before (duplicated issue), please ask in the original issue>
<If your issue is wifi problem or mqtt problem, please try first the steps provided in troubleshooting of the wiki>

Please take a few minutes to complete the requested information below. Our ability to provide assistance is greatly hampered without it. The details requested potentially affect which options to pursue. The small amount of time you spend completing the template will also help the volunteers providing the assistance to you to reduce the time required to help you.
> **GUIDE**
>
> This BUG issue template is meant to REPORT Tasmota software BUGS ONLY>
>
> Please DO NOT OPEN AN ISSUE:
> - If your Tasmota version is not the latest from the development branch, please update your device before submitting your issue. Your problem might already be solved. The latest precompiled binaries of Tasmota can be downloaded from http://thehackbox.org/tasmota/>
> - If your issue is a flashing issue, please address it to the Tasmota Support Chat>
> - If your issue is compilation problem, please address it to the Tasmota Support Chat>
> - If your issue has been addresed before (duplicated issue), please ask in the original issue>
> - If your issue is a Wi-Fi problem or MQTT problem, please try the steps provided in the FAQ and troubleshooting wiki articles>
>
> Please take a few minutes to complete the requested information below. Our ability to provide assistance is greatly hampered without it. The details requested potentially affect which options to pursue. The small amount of time you spend completing the template will also help the volunteers providing the assistance to you to reduce the time required to help you.
### BUG DESCRIPTION
_A clear and concise description of what the bug is._


### REQUESTED INFORMATION
_Make sure these boxes are checked before submitting your issue. Thank you_
_Make sure your have performed every step and checked the applicable boxes before submitting your issue. Thank you!_

**FAILURE TO COMPLETE THE REQUESTED INFORMATION WILL RESULT IN YOUR ISSUE BEING CLOSED**

Expand All @@ -31,22 +30,35 @@ _Make sure these boxes are checked before submitting your issue. Thank you_
- [ ] Searched the problem in the wiki (/~https://github.com/arendst/Sonoff-Tasmota/wiki/Troubleshooting)
- [ ] Searched the problem in the forum (https://groups.google.com/d/forum/sonoffusers)
- [ ] Searched the problem in the chat (https://discord.gg/Ks2Kzd4)
- [ ] Device used (i.e. Sonoff Basic) : _____
- [ ] Tasmota binary firmware version number used : ____ / (pre-compiled or self-compiled ?)
- [ ] Development IDE - Compiler / Upload tools used : ____ / ____
- [ ] Provide the output of command ``status 0`` :
```
STATUS 0 OUTPUT HERE:
```
- [ ] Provide the output of console when you experience your issue if apply :
_(Please use_ ``weblog 4`` _for more debug information)_
```
CONSOLE OUTPUT HERE:
```
- [ ] Device used (e.g., Sonoff Basic): _____
- [ ] Tasmota binary firmware version number used: _____
- [ ] Pre-compiled
- [ ] Self-compiled
- [ ] IDE / Compiler
- [ ] Flashing tools used: _____
- [ ] Provide the output of command ``Backlog Template; Module; GPIO``:
```
Configuration output here:
```
- [ ] If using rules, provide the output of command ``Backlog Rule1; Rule2; Rule3``:
```
Rules output here:
```
- [ ] Provide the output of command ``Status 0``:
```
STATUS 0 output here:
```
- [ ] Provide the output of console when you experience your issue if applicable:
_(Please use_ ``weblog 4`` _for more debug information)_
```
Console output here:
```

### TO REPRODUCE
_Steps to reproduce the behavior:_
Expand Down
73 changes: 43 additions & 30 deletions .github/ISSUE_TEMPLATE/Custom.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
---
name: Troubleshooting
about: Users Troubleshooting Help

---

<GUIDE>

<This troubleshooting issue template is meant to help Tasmota users with difficult problems. It is aimed to be opened if using the wiki and the support chat could not solve the issue. The Github Issue tracker is NOT a general discussion forum>

<Please DO NOT OPEN AN ISSUE:>
<If you have general questions or you need help on Tasmota usage, go to the Tasmota support chat>
<If your Tasmota version is not the latest, please update before posting. Your issue might be already solved. Latest precompiled bins of Tasmota can be downloaded from http://thehackbox.org/tasmota/>
<If your issue is a new device, please use the Tasmota Template Feature. See wiki for that>
<If your issue is a flashing issue, please address that to the Tasmota Support Chat>
<If your issue is compilation problem, please address that to the Tasmota Support Chat>
<If your issue has been addresed before (duplicated issue), please ask in the original issue>
<If your issue is wifi problem or mqtt problem, please try first the steps provided in troubleshooting of the wiki>

Please take a few minutes to complete the requested information below. Our ability to provide assistance is greatly hampered without it. The details requested potentially affect which options to pursue. The small amount of time you spend completing the template will also help the volunteers providing the assistance to you to reduce the time required to help you.
> **GUIDE**
>
> This troubleshooting issue template is meant to help Tasmota users with difficult problems. It is aimed to be opened if using the wiki and the support chat could not solve the issue. The Github Issue tracker is NOT a general discussion forum!
>
> Please DO NOT OPEN AN ISSUE:
> - If you have general questions or you need help on Tasmota usage, go to the Tasmota support chat
> - If your Tasmota version is not the latest from the development branch, please update your device before submitting your issue. Your problem might already be solved. The latest precompiled binaries of Tasmota can be downloaded from http://thehackbox.org/tasmota/
> - If your issue is about a new device, please use the Tasmota [Template](../wiki/Templates) feature.
> - If your issue is a flashing issue, please address it to the Tasmota Support Chat
> - If your issue is compilation problem, please address it to the Tasmota Support Chat
> - If your issue has been addresed before (duplicated issue), please ask in the original issue
> - If your issue is a Wi-Fi problem or MQTT problem, please try the steps provided in the FAQ and troubleshooting wiki articles
>
> Please take a few minutes to complete the requested information below. Our ability to provide assistance is greatly hampered without it. The details requested potentially affect which options to pursue. The small amount of time you spend completing the template will also help the volunteers providing the assistance to you to reduce the time required to help you.
### ISSUE DESCRIPTION - TROUBLESHOOTING
_A clear description of what the issue is and be as extensive as possible_
Expand All @@ -33,20 +32,34 @@ _Make sure these boxes are checked before submitting your issue. Thank you_
- [ ] Searched the problem in the wiki (/~https://github.com/arendst/Sonoff-Tasmota/wiki/Troubleshooting)
- [ ] Searched the problem in the forum (https://groups.google.com/d/forum/sonoffusers)
- [ ] Searched the problem in the chat (https://discord.gg/Ks2Kzd4)
- [ ] Device used (i.e. Sonoff Basic) : _____
- [ ] Tasmota binary firmware version number used : ____ / (pre-compiled or self-compiled ?)
- [ ] Development IDE - Compiler / Upload tools used : ____ / ____
- [ ] Provide the output of command ``status 0`` :
```
STATUS 0 OUTPUT HERE:
```
- [ ] Provide the output of console when you experience your issue if apply :
_(Please use_ ``weblog 4`` _for more debug information)_
```
CONSOLE OUTPUT HERE:
- [ ] Device used (e.g., Sonoff Basic): _____
- [ ] Tasmota binary firmware version number used: _____
- [ ] Pre-compiled
- [ ] Self-compiled
- [ ] IDE / Compiler
- [ ] Flashing tools used: _____
- [ ] Provide the output of command ``Backlog Template; Module; GPIO``:
```
Configuration output here:
```
- [ ] If using rules, provide the output of command ``Backlog Rule1; Rule2; Rule3``:
```
Rules output here:
```
- [ ] Provide the output of command ``Status 0``:
```
STATUS 0 output here:
```
- [ ] Provide the output of console when you experience your issue if applicable:
_(Please use_ ``weblog 4`` _for more debug information)_
```
Console output here:
```

```
**(Please, remember to close the issue when the problem has been addressed)**
16 changes: 8 additions & 8 deletions .github/ISSUE_TEMPLATE/Feature_request.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
---
name: Feature request
about: Suggest an idea for this project

---
Please take a few minutes to complete the requested information below. Our ability to provide assistance is greatly hampered without it. The details requested potentially affect which options to pursue. The small amount of time you spend completing the template will also help the volunteers providing the assistance to you to reduce the time required to help you.

**Have you looked for this feature in other issues and in the wiki?**
> Please take a few minutes to complete the requested information below. Our ability to provide assistance is greatly hampered without it. The details requested potentially affect which options to pursue. The small amount of time you spend completing the template will also help the volunteers providing the assistance to you to reduce the time required to help you.
**Have you looked for this feature in other issues and in the wiki?**

**Is your feature request related to a problem? Please describe.**
**Is your feature request related to a problem? Please describe.**
_A clear and concise description of what the problem is._

**Describe the solution you'd like**
**Describe the solution you'd like**
_A clear and concise description of what you want to happen._

**Describe alternatives you've considered**
**Describe alternatives you've considered**
_A clear and concise description of any alternative solutions or features you've considered._

**Additional context**
**Additional context**
_Add any other context or screenshots about the feature request here._

**(Please, remember to close the issue when the problem has been addressed)**
**(Please, remember to close the issue when the problem has been addressed)**
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
- [ ] The pull request is done against the latest dev branch
- [ ] Only relevant files were touched
- [ ] Only one feature/fix was added per PR.
- [ ] The code change is tested and works on core 2.3.0, 2.4.2 and 2.5.2
- [ ] The code change is tested and works on core 2.3.0, 2.4.2, 2.5.2, and pre-2.6
- [ ] The code change pass travis tests. **Your PR cannot be merged unless tests pass**
- [ ] I accept the [CLA](/~https://github.com/arendst/Sonoff-Tasmota/blob/development/CONTRIBUTING.md#contributor-license-agreement-cla).
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
sonoff/user_config_override.h
build
firmware.map
firmware.asm

## Visual Studio Code specific ######
.vscode
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: python
python:
- '2.7'
- '3.7'
sudo: false
install:
- pip install -U platformio
Expand Down
2 changes: 1 addition & 1 deletion lib/FT6236-gemu-1.0/FT6236.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ uint16_t FT6236GetButtonMask(void) {

void FT6236begin(uint8_t i2c_addr) {
FT6236_i2c_addr=i2c_addr;
Wire.begin(FT6236_i2c_addr);
Wire.begin();
FT6236writeTouchRegister(0,FT6236_MODE_NORMAL);
lenLibVersion = FT6236readTouchAddr(0x0a1, FT6236buf, 2 );
firmwareId = FT6236readTouchRegister( 0xa6 );
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "TasmotaModbus",
"version": "1.1.1",
"version": "1.2.0",
"keywords": [
"serial", "io", "TasmotaModbus"
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=TasmotaModbus
version=1.1.1
version=1.2.0
author=Theo Arends
maintainer=Theo Arends <theo@arends.com>
sentence=Basic modbus wrapper for TasmotaSerial for ESP8266.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ void TasmotaModbus::Send(uint8_t device_address, uint8_t function_code, uint16_t

frame[0] = mb_address; // 0xFE default device address or dedicated like 0x01
frame[1] = function_code;
frame[2] = (uint8_t)(start_address >> 8);
frame[3] = (uint8_t)(start_address);
frame[4] = (uint8_t)(register_count >> 8);
frame[5] = (uint8_t)(register_count);
frame[2] = (uint8_t)(start_address >> 8); // MSB
frame[3] = (uint8_t)(start_address); // LSB
frame[4] = (uint8_t)(register_count >> 8); // MSB
frame[5] = (uint8_t)(register_count); // LSB
uint16_t crc = CalculateCRC(frame, 6);
frame[6] = (uint8_t)(crc);
frame[7] = (uint8_t)(crc >> 8);
Expand All @@ -80,35 +80,48 @@ bool TasmotaModbus::ReceiveReady()

uint8_t TasmotaModbus::ReceiveBuffer(uint8_t *buffer, uint8_t register_count)
{
uint8_t len = 0;
mb_len = 0;
uint32_t last = millis();
while ((available() > 0) && (len < (register_count *2) + 5) && (millis() - last < 10)) {
while ((available() > 0) && (mb_len < (register_count *2) + 5) && (millis() - last < 10)) {
uint8_t data = (uint8_t)read();
if (!len) { // Skip leading data as provided by hardware serial
if (!mb_len) { // Skip leading data as provided by hardware serial
if (mb_address == data) {
buffer[len++] = data;
buffer[mb_len++] = data;
}
} else {
buffer[len++] = data;
if (3 == len) {
buffer[mb_len++] = data;
if (3 == mb_len) {
if (buffer[1] & 0x80) { // 01 84 02 f2 f1
return buffer[2]; // 1 = Illegal Function, 2 = Illegal Address, 3 = Illegal Data, 4 = Slave Error
return buffer[2]; // 1 = Illegal Function,
// 2 = Illegal Data Address,
// 3 = Illegal Data Value,
// 4 = Slave Error
// 5 = Acknowledge but not finished (no error)
// 6 = Slave Busy
// 8 = Memory Parity error
// 10 = Gateway Path Unavailable
// 11 = Gateway Target device failed to respond
}
}
}
last = millis();
}

if (len < 7) { return 7; } // 7 = Not enough data
if (len != buffer[2] + 5) {
buffer[2] = len - 5; // As it's wrong anyway let's store actual number received in here (5 will be added by client)
return 8; // 8 = Unexpected result
if (mb_len < 7) { return 7; } // 7 = Not enough data

/*
if (mb_len != buffer[2] + 5) {
buffer[2] = mb_len - 5; // As it's wrong anyway let's store actual number received in here (5 will be added by client)
return 3; // 3 = Unexpected result
}
*/

uint16_t crc = (buffer[len -1] << 8) | buffer[len -2];
if (CalculateCRC(buffer, len -2) != crc) { return 9; } // 9 = crc error
uint16_t crc = (buffer[mb_len -1] << 8) | buffer[mb_len -2];
if (CalculateCRC(buffer, mb_len -2) != crc) {
return 9; // 9 = crc error
}

return 0; // 0 = No error
return 0; // 0 = No error
}

uint8_t TasmotaModbus::Receive16BitRegister(uint16_t *value)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,28 @@ class TasmotaModbus : public TasmotaSerial {
bool ReceiveReady();

/* Return codes:
* 0 - No error
* 1 - Illegal function
* 2 - Illegal address
* 3 - Illegal data
* 4 - Slave error
* 7 - Not enough minimal data received
* 8 - Not enough data receieved
* 9 - Crc error
* 0 = No error
* 1 = Illegal Function,
* 2 = Illegal Data Address,
* 3 = Illegal Data Value,
* 4 = Slave Error
* 5 = Acknowledge but not finished (no error)
* 6 = Slave Busy
* 7 = Not enough minimal data received
* 8 = Memory Parity error
* 9 = Crc error
* 10 = Gateway Path Unavailable
* 11 = Gateway Target device failed to respond
*/
uint8_t ReceiveBuffer(uint8_t *buffer, uint8_t register_count);
uint8_t Receive16BitRegister(uint16_t *value);
uint8_t Receive32BitRegister(float *value);

uint8_t ReceiveCount(void) { return mb_len; }

private:
uint8_t mb_address;
uint8_t mb_len;
};

#endif // TasmotaModbus_h
9 changes: 9 additions & 0 deletions pio/obj-dump.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Little convenience script to get an object dump

Import('env')

def obj_dump_after_elf(source, target, env):
print("Create firmware.asm")
env.Execute("xtensa-lx106-elf-objdump "+ "-D " + str(target[0]) + " > "+ "${PROGNAME}.asm")

env.AddPostAction("$BUILD_DIR/${PROGNAME}.elf", [obj_dump_after_elf])
1 change: 1 addition & 0 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ upload_resetmethod = nodemcu
; *** Upload Serial reset method for Wemos and NodeMCU
upload_port = COM5
extra_scripts = pio/strip-floats.py
pio/obj-dump.py

; *** Upload file to OTA server using SCP
;upload_port = user@host:/path
Expand Down
Loading

0 comments on commit 3f7b499

Please sign in to comment.