You can install our site as a web app on your iOS device by utilizing the Add to Home Screen feature in Safari. Please see this thread for more details on this.
Note: This feature may not be available in some browsers.
Pretty bad. I've been caught up in way to many projects recently. I did a Electric Scooter conversion ( Building a Lithium battery for my electric scooter – Widodh ) which sucked up all my time.@widodh - what state is the Python script in? Is the version on GitHub working?
I just need to get working on the code again.
That sounds very interesting! The Python code could mimic a SSDP server once it talks with the TWC.Thanks for the quick update. Sounds cool. If I find time to play with it I'll update you.
I'm looking to develop code so the TWC appears as a discoverable device via SSDP. The plan is to then develop a hub app that finds devices in the home like WEMO switches etc and then allow configuration of priorities via a cloud app for smart energy usage.
Hi everyone. I bought my first Raspberry Pi (W Zero) to give this awesome project a try.
@CDragon - is there an update to the TWCManager.pl file on Github? After lots of testing it looks like I'm getting the same issue as others where I have errors because the message is 18 bytes long, whereas the TWCManager file is written around a 16byte message. This is identified in January and February 2018 messages in this thread, but github's last version of the perl script is in December.
Just in case mine is a different issue, logging at debug level 10, it starts like this.
TWC Manager starting as fake Master with id 7777 and sign 77
19:59:55: Send master linkready1
Tx@19:59:55: c0 fc e1 77 77 77 00 00 00 00 00 00 00 00 46 c0 fe
19:59:55: Send master linkready1
Tx@19:59:55: c0 fc e1 77 77 77 00 00 00 00 00 00 00 00 46 c0 fe
19:59:55: Send master linkready1
Tx@19:59:55: c0 fc e1 77 77 77 00 00 00 00 00 00 00 00 46 c0 fe
19:59:55: Send master linkready1
Tx@19:59:55: c0 fc e1 77 77 77 00 00 00 00 00 00 00 00 46 c0 fe
19:59:55: Send master linkready1
Tx@19:59:55: c0 fc e1 77 77 77 00 00 00 00 00 00 00 00 46 c0 fe
19:59:55: Send master linkready2
Tx@19:59:55: c0 fb e2 77 77 77 00 00 00 00 00 00 00 00 47 c0 fe
19:59:55: Send master linkready2
Tx@19:59:55: c0 fb e2 77 77 77 00 00 00 00 00 00 00 00 47 c0 fe
19:59:55: Send master linkready2
Tx@19:59:55: c0 fb e2 77 77 77 00 00 00 00 00 00 00 00 47 c0 fe
19:59:55: Send master linkready2
Tx@19:59:55: c0 fb e2 77 77 77 00 00 00 00 00 00 00 00 47 c0 fe
19:59:55: Send master linkready2
Tx@19:59:55: c0 fb e2 77 77 77 00 00 00 00 00 00 00 00 47 c0 fe
Rx@19:59:56: c0 fd e2 26 85 9d 0c 80 00 00 00 00 00 00 00 00 b6 c0
ERROR: Ignoring message of unexpected length 18: c0 fd e2 26 85 9d 0c 80 00 00 00 00 00 00 00 00 b6 c0
Rx@19:59:56: c0 fd e2 26 85 9d 0c 80 00 00 00 00 00 00 00 00 b6 c0
ERROR: Ignoring message of unexpected length 18: c0 fd e2 26 85 9d 0c 80 00 00 00 00 00 00 00 00 b6 c0
Rx@19:59:56: c0 fd e2 26 85 9d 0c 80 00 00 00 00 00 00 00 00 b6 c0
ERROR: Ignoring message of unexpected length 18: c0 fd e2 26 85 9d 0c 80 00 00 00 00 00 00 00 00 b6 c0
Rx@19:59:58: c0 fd e2 26 85 9d 0c 80 00 00 00 00 00 00 00 00 b6 c0
ERROR: Ignoring message of unexpected length 18: c0 fd e2 26 85 9d 0c 80 00 00 00 00 00 00 00 00 b6 c0
The raw data looks like this (taken after it has been on for a while). (logged with "od -t x1 < /dev/ttyUSB0")
pi@TWCManager:~/TWC $ od -t x1 < /dev/ttyUSB0
0000000 00 fc c0 fd e2 26 85 9d 0c 80 00 00 00 00 00 00
0000020 00 00 b6 c0 fc c0 fd e2 26 85 9d 0c 80 00 00 00
0000040 00 00 00 00 00 b6 c0 fc c0 fd e2 26 85 9d 0c 80
0000060 00 00 00 00 00 00 00 00 b6 c0 fc c0 fd e2 26 85
0000100 9d 0c 80 00 00 00 00 00 00 00 00 b6 c0 fc c0 fd
0000120 e2 26 85 9d 0c 80 00 00 00 00 00 00 00 00 b6 c0
0000140 fc c0 fd e2 26 85 9d 0c 80 00 00 00 00 00 00 00
0000160 00 b6 c0 fc c0 fd e2 26 85 9d 0c 80 00 00 00 00
0000200 00 00 00 00 b6 c0 fc c0 fd e2 26 85 9d 0c 80 00
0000220 00 00 00 00 00 00 00 b6 c0 fc c0 fd e2 26 85 9d
0000240 0c 80 00 00 00 00 00 00 00 00 b6 c0 fc c0 fd e2
0000260 26 85 9d 0c 80 00 00 00 00 00 00 00 00 b6 c0 fc
0000300 c0 fd e2 26 85 9d 0c 80 00 00 00 00 00 00 00 00
0000320 b6 c0 fc c0 fd e2 26 85 9d 0c 80 00 00 00 00 00
0000340 00 00 00 b6 c0 fc c0 fd e2 26 85 9d 0c 80 00 00
I have tried 2 different usb-485 adaptors - one with and one without the 120ohm and 680ohm resistors. Cable is short and shielded - both give the same result.
Thanks CDragon. It would be interesting to see the current code for the v2 protocol, I'd like to stop charging via a call to the Tesla Vehicle API instead of manipulating the wall connector.I haven't updated the git code since December because I still haven't found a way to cleanly stop the car from charging in newer TWC models. Ceasing communication with the TWC will stop charging but randomly put the car in an error state where it won't start charging again until you re-plug the connector, as I've described in previous posts. I don't want to put up new code that will randomly cause cars to stop charging and leave people stranded.
Unfortunately I don't have an ETA on when or if I will find a solution.
unfortunately my TWC has some communication issues with TWCManager. I get most the time UNKNOWN MESSAGE FROM SLAVE
c0 fc e1 00 85 12 00 00 00 00 00 00 00 00 78 c0or
c0 fb e2 00 85 12 00 00 00 00 00 00 00 00 79 c0
Thanks CDragon. It would be interesting to see the current code for the v2 protocol, I'd like to stop charging via a call to the Tesla Vehicle API instead of manipulating the wall connector.
Thanks a lot. I got same hint already from a good soul and that helped a lot. Soemtimes I do not see the wood for the tree...Those two messages are linkready1 and linkready2 from a master TWC. This means you have a TWC on the network set to Master mode. You need to rotate the rotary switch inside the TWC to point at position F on the dial after powering down the TWC.
My current code is a mess of test cases but I've attached a version to this message ....
So for a future realease it would maybe an idea to have an additional URL parameter to switch power externaly without saving the settings always to the file. Just to rest the SD card a little.
Good idea, I think i will do the same, Thanks!I use TMPFS on my Raspberry Pis to do exactly that
I use TMPFS on my Raspberry Pis to do exactly that. Mount a ram drive and use that to save the write cycles.
My first reaction to this idea was "you've learned your lesson about sending random commands - don't do it again!" But I realized you have nothing to lose at this point. It's not responding to any messages.The fact I can't get TWC 2 to respond to any commands makes me think there's nothing more I can do. I guess I should try sending it commands 0000 to FFFF in case it's in a debugging mode that's waiting for some particular command to get it out of the mode.
My first reaction to this idea was "you've learned your lesson about sending random commands - don't do it again!" But I realized you have nothing to lose at this point. It's not responding to any messages.
$self->{masterHeartbeatData} = [0x05,
$self->{masterHeartbeatData} = [0x09,
vloschiavo pointed out that TWCManagerProtocol2.pl won't change the car's charging amps once charging has started at a particular amp value. This is because protocol 2 uses state 09 instead of state 05 to set an absolute amp value. Protocol 2 does use state 05 as well, but only to tell a car to start charging at an amp value, not to change the amp value once it's started. Using 09 in both cases seems to work, so change this line in TWCManagerProtocol2.pl:
to this:Code:$self->{masterHeartbeatData} = [0x05,
Code:$self->{masterHeartbeatData} = [0x09,