Tasmota: TM1637 integration

Created on 24 Jul 2018  路  14Comments  路  Source: arendst/Tasmota

Make sure these boxes are checked [x] before submitting your issue - Thank you!

  • [x] Searched the problem in issues (https://github.com/arendst/Sonoff-Tasmota/issues)
  • [x] Searched the problem in the wiki (https://github.com/arendst/Sonoff-Tasmota/wiki/Troubleshooting)
  • [x] Searched the problem in the forum (https://forum.digital-pig.com/)
  • [x] Searched the problem in the discussion group (https://groups.google.com/d/forum/sonoffusers)
  • [x] Hardware used : TH10
  • [x] Provide the output of command status 0 :
09:03:06 RSL: tanktemp1/stat/STATUS = {"Status":{"Module":4,"FriendlyName":["Tanktemp1"],"Topic":"tanktemp1","ButtonTopic":"0","Power":0,"PowerOnState":3,"LedState":1,"SaveData":1,"SaveState":1,"ButtonRetain":0,"PowerRetain":0}}
09:03:06 RSL: tanktemp1/stat/STATUS1 = {"StatusPRM":{"Baudrate":115200,"GroupTopic":"sonoffs","OtaUrl":"http://sonoff.maddox.co.uk/tasmota/sonoff.bin","RestartReason":"Power on","Uptime":"11T22:15:08","StartupUTC":"2018-07-12T09:47:58","Sleep":0,"BootCount":37,"SaveCount":77,"SaveAddress":"F7000"}}
09:03:06 RSL: tanktemp1/stat/STATUS2 = {"StatusFWR":{"Version":"5.14.0b","BuildDateTime":"2018.07.12 11:04:15","Boot":31,"Core":"2_4_1","SDK":"2.2.1(cfd48f3)"}}
09:03:06 RSL: tanktemp1/stat/STATUS3 = {"StatusLOG":{"SerialLog":2,"WebLog":2,"SysLog":0,"LogHost":"","LogPort":514,"SSId":["schwan1",""],"TelePeriod":300,"SetOption":["00008009","55818000"]}}
09:03:06 RSL: tanktemp1/stat/STATUS4 = {"StatusMEM":{"ProgramSize":544,"Free":456,"Heap":15,"ProgramFlashSize":1024,"FlashSize":1024,"FlashMode":3,"Features":["00000807","0FDAE794","00000000","17B6179A","00000000"]}}
09:03:06 RSL: tanktemp1/stat/STATUS5 = {"StatusNET":{"Hostname":"tanktemp1-3943","IPAddress":"192.168.123.7","Gateway":"192.168.123.253","Subnetmask":"255.255.255.0","DNSServer":"192.168.123.253","Mac":"EC:FA:BC:00:CF:67","Webserver":2,"WifiConfig":3}}
09:03:06 RSL: tanktemp1/stat/STATUS6 = {"StatusMQT":{"MqttHost":"192.168.123.123","MqttPort":1883,"MqttClientMask":"DVES_%06X","MqttClient":"DVES_00CF67","MqttUser":"Braumeister","MqttType":1,"MAX_PACKET_SIZE":1000,"KEEPALIVE":15}}
09:03:06 RSL: tanktemp1/stat/STATUS7 = {"StatusTIM":{"UTC":"Tue Jul 24 08:03:06 2018","Local":"Tue Jul 24 09:03:06 2018","StartDST":"Sun Mar 25 02:00:00 2018","EndDST":"Sun Oct 28 03:00:00 2018","Timezone":1,"Sunrise":"05:13","Sunset":"20:40"}}
09:03:06 RSL: tanktemp1/stat/STATUS10 = {"StatusSNS":{"Time":"2018-07-24T09:03:06","DS18B20":{"Temperature":23.4},"TempUnit":"C"}}
09:03:06 RSL: tanktemp1/stat/STATUS11 = {"StatusSTS":{"Time":"2018-07-24T09:03:06","Uptime":"11T22:15:08","Vcc":3.486,"POWER":"OFF","Wifi":{"AP":1,"SSId":"schwan1","RSSI":44,"APMac":"54:E6:FC:CD:E0:87"}}}

Hi

I took over the task to implement the TM1637 library into Sonoff Tasmota from Highcooley. I have worked on it and done a lot or research but couldn't ever get any output on the display, maybe I don't see the forest for the trees. Therefore I need some external input now ;-)

I'm using Arduino IDE and the TM1637 library available here:

https://github.com/avishorp/TM1637

which I added to the Sketchbook/libraries folder.

Let me explain what I added so far to Sonoff-Tasmota:

To make GPIO 2 and 5 availabe as a choice in the web interface I changed the relevant two lines in sonoff_template.h, const mytmplt kModules[MAXMODULE], section "Sonoff TH":
GPIO_USER, // GPIO02
GPIO_USER, // GPIO05

(at the moment I'm using GPIOs 2 and 4 though). Hardware mods have been done.

To add the pins to the dropdowns and hopefully give them some functionality I did the following:

  • in sonoff_template.h, const char kSensorNames[], added
    D_SENSOR_TM1637_CLK
    D_SENSOR_TM1637_DIO
    and in enum UserSelectablePins
    GPIO_TM1637_CLK, // TM1637 LED panel
    GPIO_TM1637_DIO, // TM1637 LED panel
  • in de-CH.h added (this is the language file I'm using)
    #define D_SENSOR_TM1637_CLK "TM1637 CLK"
    #define D_SENSOR_TM1637_DIO "TM1637 DIO"
  • in support.ino added
    #ifndef USE_TM1637
    if (GPIO_TM1637_CLK == val) { return true; }
    if (GPIO_TM1637_DIO == val) { return true; }
    #endif
  • in user_config.h added
    #define USE_TM1637

This resulted in:
grafik

Then I created the file xsns_TM1637.ino that is attached.

Maybe the code is not executed at all as I don't see any action at all at either of the two pins.

I'm pretty sure I'm basically overlooking something but I haven't been able to figure it out. Can someone help please?

Kind regards
Martin

xsns_26_TM1637.zip

requested feature (hold over)

Most helpful comment

If I may ... I think it would be beneficial to have TM1637 support.

All 14 comments

You should have gotten a compile error, since you are redefining sns_26. You should use one of the numbers reserved for user sensors (91 to 98 or 99)

You need to add something to GpioInit() to initialize the GPIO pins that are used. It lives in sonoff.ino

Did you see this https://github.com/arendst/Sonoff-Tasmota/wiki/Sensor-API

The real problem is how are you going to get the display to show something useful?
What commands will you enable to allow an MQTT message to control the display?

The simplest way to send data to display would probably be to implement a sensorXX callback

Hi,

Any updates on this? Thanks.

Hi, someone is working in a driver for Tasmota for this?

Hi,
i see no need for "just another" display. Dot Matrix Display, LCD, TFT and OLED already supported.
Nobody else was asking for...

If I may ... I think it would be beneficial to have TM1637 support.

No offend, interest. For what?

Simple NTP based clock using WeMos D1.

Works already nice with LCD, OLED or Matrix Display

I agree with @Jason2866

I actually considered buying one of these modules with the intention of writing a driver for it but then I started thinking what I would use it for that cannot already be done with what is supported and I already have in my possession - needless to say, I hit a blank.

Hi,

Closing issue as there isn't someone interested on writing a driver for this.

The label hold over is added for future reference.

Thanks everyone for sharing theirs ideas.

Hi, are you still out there? I have a bunch of these display and would like to use them for temperature display. Would be happy to work on it with you.

I took over the task to implement the TM1637 library into Sonoff Tasmota from Highcooley. I have worked on it and done a lot or research but couldn't ever get any output on the display, maybe I don't see the forest for the trees. Therefore I need some external input now ;-)

@pwbecker no one stops you for providing a PR :-)

Was this page helpful?
0 / 5 - 0 ratings