CANserver Development

pyjamasam

Active member
Joined
Feb 24, 2020
Messages
58
Location
Ontario, Canada
Country
Country
Tesla Owner
Model 3
FW 2.0+ is no more open source, right?
The code for v2+ isn't posted publicly, but we have a number of people all tinkering with the code in our discord community. I'd be glad to answer any questions you might have about the firmware.

chris.
 

Eugenius

Active member
Joined
Jun 27, 2019
Messages
39
Location
Nuremberg
Country
Country
Tesla Owner
Model 3
The code for v2+ isn't posted publicly, but we have a number of people all tinkering with the code in our discord community. I'd be glad to answer any questions you might have about the firmware.

chris.
Is there a chance to extract panda server 2.0 part from it? Maybe you can post it as a external library?
I would like to use panda server for SMT in my own project.
 

pyjamasam

Active member
Joined
Feb 24, 2020
Messages
58
Location
Ontario, Canada
Country
Country
Tesla Owner
Model 3
yeah, I know, thx!
but there no filters implemented, right? that's why I would use v2 for it, to use it faster...
I have documented the v2 extensions I made to the protocol here:
https://github.com/joshwardell/CANserver/wiki/PandaProtocol

That should be the info you are looking for. It has all the details about what bytes do what. (like setting up filters, and clearing etc).

Let me know if you have any questions.

chris.
 
  • Like
Reactions: Eugenius

Eugenius

Active member
Joined
Jun 27, 2019
Messages
39
Location
Nuremberg
Country
Country
Tesla Owner
Model 3
I have documented the v2 extensions I made to the protocol here:
https://github.com/joshwardell/CANserver/wiki/PandaProtocol

That should be the info you are looking for. It has all the details about what bytes do what. (like setting up filters, and clearing etc).

Let me know if you have any questions.

chris.
Why I'm asking:
I have an "adaptor" for Bluetooh SMT communction build with ESP32: https://github.com/Adminius/ESP32-ScanMyTesla
My next step was to do an "offline" logger like TeslaFI or TeslaLogger directly with ESP32 with logging to SD Card in the car and sync data to RasPi with DB and Grafana on it placed at home (maybe I will make integration direkt into TeslaLogger).
CANServer is actually perfect for it, but, CANServer doesn't support multiplexed messages yet :/
So, my Idea was to do my logger with at least panda server instead of slow Bluetooth part.
Is multiplexed message decoding planned? if yes, I will wait for it...
 

pyjamasam

Active member
Joined
Feb 24, 2020
Messages
58
Location
Ontario, Canada
Country
Country
Tesla Owner
Model 3
Why I'm asking:
I have an "adaptor" for Bluetooh SMT communction build with ESP32: https://github.com/Adminius/ESP32-ScanMyTesla
My next step was to do an "offline" logger like TeslaFI or TeslaLogger directly with ESP32 with logging to SD Card in the car and sync data to RasPi with DB and Grafana on it placed at home (maybe I will make integration direkt into TeslaLogger).
CANServer is actually perfect for it, but, CANServer doesn't support multiplexed messages yet :/
So, my Idea was to do my logger with at least panda server instead of slow Bluetooth part.
Is multiplexed message decoding planned? if yes, I will wait for it...
Screen Shot 2021-09-08 at 10.36.11 AM.png


The 2.1 beta build has full support for multiplexed CAN signals :)

There is also some new webhook support in 2.1 that can be leveraged to auto trigger a log download when connecting to a wifi network. Makes automated log collection and download really nice now, and I think would work well in the use case you are trying to.

Also if you do direct to teslalogger (or teslamate) that would be amazing. Its one of the things we have been wanting for a while.

Jump on over to our discord and I can get you setup with a build to play with.

chris.
 
Last edited:
  • Like
Reactions: Eugenius

JWardell

TOO Master Member 👑
TOO Sponsor Vendor
Joined
May 9, 2016
Messages
4,941
Location
Boston
Country
Country
Tesla Owner
Model 3
CANServer is actually perfect for it, but, CANServer doesn't support multiplexed messages yet :/

CANserver always logs and passes the entire message data to devices, so multiplexed messages have always worked for connected phone apps and log analysis. The multiplexing support (which as mentioned is coming soon) is strictly internal for easily adding signals into onboard lua processing scripts (ultimately for microdisplays), and is easily worked around with an if statement validating the signal with only the proper multiplexor value. I use it with my display for pack balancing for example.
But your intended use of auto processing logs will certainly work. Though I really would like to have some kind of universal method of auto-uploading logs to cloud services like TeslaFi, DIY Pi processing services, or just a home network NAS.
 
  • Like
Reactions: Eugenius

Eugenius

Active member
Joined
Jun 27, 2019
Messages
39
Location
Nuremberg
Country
Country
Tesla Owner
Model 3
I'll not log whole CAN message (I can do it with my own implementation), I will log decoded value in "specials" format.

My idea is:

one csv file/trip. Each line contains position, Speed, Power and so on. Each line will be created by position change.
e.g.: UTC_TIME;LAT;LONG;SPEED;POWER;SoC...
with file name like utctime_trip.scv to have differentiation between different trips

after file is created and "offline-logger" has connection to TeslaLogger (or what ever server) it uploads this file.
TeslaLogger/Server reads line by line this file and saves it to internal db in its own format.

The same for charging-sessions and so on.

So I think this is possible with lua scripting.

for Upload we can use ESP32 FTP client like this: https://github.com/ldab/ESP32_FTPClient
There are also libs for DropBox and GDrive available, so you can be some where with internet connction and upload it to the cloud and not directly to RasPi.
 

JWardell

TOO Master Member 👑
TOO Sponsor Vendor
Joined
May 9, 2016
Messages
4,941
Location
Boston
Country
Country
Tesla Owner
Model 3
Ahhh I see, you want onboard decoding to intermittant csv file, which I can certainly see to be useful. I don't think we can do that though but I bet we can in the future. @pyjamasam
 
  • Like
Reactions: Eugenius

pyjamasam

Active member
Joined
Feb 24, 2020
Messages
58
Location
Ontario, Canada
Country
Country
Tesla Owner
Model 3
Ahhh I see, you want onboard decoding to intermittant csv file, which I can certainly see to be useful. I don't think we can do that though but I bet we can in the future. @pyjamasam
Hmmm. A custom log file that you can write what ever you want to from LUA... That wouldn't be too bad to do. Let me noodle on that.

chris.
 
  • Like
Reactions: Eugenius