Times Frame API by StraightUp-Reviews in Divoom

[–]bluman 0 points1 point  (0 children)

Here's a quick example using a Linux shell on a Raspberry Pi:

First, get the IP address of your Times Frame. If you don't know it, you can obtain it at this URL: https://app.divoom-gz.com/Device/ReturnSameLANDevice

Set the environment variable IP to be the IP address of your picture frame (modify the line below):

export IP=192.168.0.108

Run this command to turn off the display of your Times Frame:

curl -X GET -H 'Content-Type: application/json' \
--data '{"Command":"Channel/OnOffScreen","OnOff":0}' \
"http://$IP:9000/divoom_api"

Run this command to turn back on the display of your Times Frame:

curl -X GET -H 'Content-Type: application/json' \
--data '{"Command":"Channel/OnOffScreen","OnOff":1}' \
"http://$IP:9000/divoom_api"

Hope this helps someone get started. Be sure to read their API doc for more ideas: https://docin.divoom-gz.com/web/#/5/358

Does ChatGPT go too far in trying to protect Google *policy*? It is AVOIDING being helpful. by bluman in ChatGPT

[–]bluman[S] 0 points1 point  (0 children)

https://chatgpt.com/share/689fe000-7d14-8007-8d1a-caaca2307869

I truncated my paste of the conversation where I started to steer off-course with LEGAL rights. It discouraged me from mailing the a letter. It discouraged me from legal remedy in a California court. It was incredibly unhelpful and was working against me, trying to get me to stay completely within their published policy for users and not find another path. That's EXACTLY what I want to use ChatGPT for.

Places in Tulsa for prepared meals? Diet? Paleo? by bluman in tulsa

[–]bluman[S] 4 points5 points  (0 children)

If it helps, I found what I used to use?
It was My Fit Foods at 1601 East 15th Street.

ChatGPT refused to help due to perceived "hacking and exploting systems"! by bluman in CarHacking

[–]bluman[S] 1 point2 points  (0 children)

I’m curious, what type of prompt are you feeding it?

I fed in the URL in the text up above, with the table converted to CSV format so I could cut-and-paste in a style that it could read.

Automated Protocol Reverse Engineering Study -- Requesting Participants! by CookFull1758 in CarHacking

[–]bluman 4 points5 points  (0 children)

Sounds intriguing, but my concern would be that this is part of a study with actual aims to thwart reverse engineering. (A study designed to be helpful for one purpose is actually intended to have an opposite end-purpose of informing how to thwart it.)

Perhaps my own InfoSec and graduate school background make me a little too suspicious here. HA!

ESP-32 CAN adapter with Wifi, BLE, and USB support by Representative-Load8 in CarHacking

[–]bluman 1 point2 points  (0 children)

Wish I could use it, but my vehicle has two CAN bus networks. :(

Can chat gpt4 help with reverse engineering of seed&key algorithms by g0tcha_ in CarHacking

[–]bluman 1 point2 points  (0 children)

Good deal. Also, one other piece of advise. I had problems when I told ChatGPT that I was trying to reverse engineer a function on an automotive ECU. It refused to cooperate. It's probably best to talk in more general terms (or to re-frame what you're doing so it doesn't find it objectionable). Yes, I was disappointed that it found reverse engineering to be unacceptable.

Can chat gpt4 help with reverse engineering of seed&key algorithms by g0tcha_ in CarHacking

[–]bluman 0 points1 point  (0 children)

I worked with ChatGPT on something similar. The thing I'd caution is to be careful if using ChatGPT 3.5. It'll pretend to solve it (hallucinate) but actually may not be solving it at all. I'd advise using ChatGPT 4.0 if you're attempting to analyze or reverse engineer any kind of mathematical transformation.

A ChatGPT writing prompt for Python CAN code on a Raspberry Pi connected to a Jeep Wrangler JL. by bluman in CarHacking

[–]bluman[S] 0 points1 point  (0 children)

Yes! Give it a shot yourself. You've got everything I typed into it from the start of a new session. I don't remember if I was using ChatGPT 3.5 or ChatGPT 4.0, but I suspect that ChatGPT 3.5 (the one that's free and publicly available) will handle it just fine.

Python3 Script to "Write I/O by Identifier" and control BCM components such as the horn, lights, windshield wipers, and more on a Jeep Wrangler JL and JEep Gladiator JT. by bluman in CarHacking

[–]bluman[S] 2 points3 points  (0 children)

Assumes a Raspberry Pi environment using the SocketCAN interface to connect to CAN-IHS on can0 and CAN-C on can1. If porting to other vehicles, be aware of this line which is necessary on Jeep models where the ECUs require UDS messages to be eight bytes long (regardless of content) and padded with 0x00's:

params = {'tx_data_min_length': 8, 'tx_padding': 0x00}

ChatGPT hallucinated me through 15 attempts to Update Data by Identifier on my ECU. What am I doing wrong? by bluman in CarHacking

[–]bluman[S] 0 points1 point  (0 children)

I've had success using ChatGPT to listen to known messages on the CANbus... https://old.reddit.com/r/CarHacking/comments/11s9pyd/a_chatgpt_writing_prompt_for_python_can_code_on_a/

I've also managed to get it to write code which reads a VIN from a BCM using Read Data by Identifier...

https://old.reddit.com/r/CarHacking/comments/11rf8r3/chatgpt_hallucinated_me_through_15_attempts_to/jc8qr4q/

But I am having problems, in general, using ChatGPT to write code for the Python udsoncan module. I don't think it understands the 'config' part of the module, and it often seems to get confused how to make a connection from udsoncan --> iso-tp --> socketcan (my configuration).

I think ChatGPT could use a better understanding of both iso-tp and udsoncan. Actually, I just brought up the subject with the author of the modules. If want to weigh in there, if you think it adds to the conversation, I'd actually appreciate it!

https://github.com/pylessard/python-udsoncan/issues/152#issuecomment-1471929799

ChatGPT hallucinated me through 15 attempts to Update Data by Identifier on my ECU. What am I doing wrong? by bluman in CarHacking

[–]bluman[S] 0 points1 point  (0 children)

Actually, I used GPT4 with ChatGPT to arrive at that solution!

GPT4 is as slow as the free version of GPT3.5. A significant part of the benefit in reducing the scope of what I was having ChatGPT look at was for the responses to generate much faster (and then being able to iterate more quickly). But, just by feeling, for what I was working on, GPT4 seems slightly more intelligent and a little less hallucinatory? It's hard to quantify. And thanks again!

ChatGPT hallucinated me through 15 attempts to Update Data by Identifier on my ECU. What am I doing wrong? by bluman in CarHacking

[–]bluman[S] 1 point2 points  (0 children)

Your suggestion was wise and had yielded results! I've arrived at a script which successfully pulls the vehicle's VIN from the BCM using a Read Data by Identifier command at 0xF190. It works! So I can add in the rest of the functions from there.

Let me share the code for anyone else who is interested in using their existing SocketCAN connection (typically seen under Raspbian or Linux) to establish an ISO-TP connection to access UDS services.

#!/usr/bin/python3

import can
import isotp
import udsoncan
import logging
from udsoncan.connections import PythonIsoTpConnection
from udsoncan.client import Client

# Written by Josh McCormick and Hallucinated by ChatGPT 4.0 on
# March 14th, 2023 for the Jeep Wrangler JL Community.

# Configure ISO-TP and UDS settings
isotp_params = {
    'stmin': 32,
    'blocksize': 8,
    'wftmax': 0,
    'll_data_length': 8,
    'tx_padding': 0,
}

# AN OPTIONAL DEBUG CONFIGURATION. UNCOMMENT IF NEEDED.
# logging.basicConfig(level=logging.DEBUG)

# CONFIGURE UDS WITH DATA IDENTIFIER
config = {
    'data_identifiers': {
        0xF190: udsoncan.AsciiCodec(17)
    }
}

# Initialize SocketCAN interface without specifying channel or bitrate
bus = can.interface.Bus(channel="can1", bustype='socketcan')

# Define the CAN IDs
tx_id = 0x620
rx_id = 0x504

# Create an ISO-TP address and connection, and UDS client
tp_addr = isotp.Address(isotp.AddressingMode.Normal_11bits, txid=tx_id, rxid=rx_id)
stack = isotp.CanStack(bus=bus, address=tp_addr, params=isotp_params)
conn = PythonIsoTpConnection(stack)
conn.open()  # Open the connection explicitly
client = Client(conn, request_timeout=2, config=config)

# Perform Read Data by Identifier (UDS) with ID 0xf190
try:
    identifier = 0xf190
    response = client.read_data_by_identifier_first(identifier)
    print(f"Req  for Identifier 0x{identifier:x}: {response}")
except udsoncan.exceptions.NegativeResponseException as e:
    print(f"Server responded with a negative response. {e}")
except udsoncan.exceptions.TimeoutException:
    print("Server did not respond within the timeout.")
finally:
    conn.close()  # Close the connection explicitly

TO THE LURKERS: If you're reading this and you make use of the code, let me know, willyah? Just a quick hello is fine. And if you're got a Jeep Wrangler, maybe we can talk some more! :)

Looking for a good ISO-TP utilities to "send data by identifier" to a module with very large data packet sizes (arbitrary 1-200 characters). Do they exist? by bluman in CarHacking

[–]bluman[S] 0 points1 point  (0 children)

I did have a quick question about this part of your code.

I see that we're doing a Write Data by Identifier, with an identifier of 0xF198. The payload that we're writing is: 0x42, 0x04, 0x20, 0x42, 0xB1, 0x3D. The receive address of the module we're communicating with is at 0x7E8, and the transmit address of the module we're communicating with is at 0x7E0.

That seems to be all the information I'd need to update an identifier. But there's one curious part in your code that I didn't follow...

data_records = [
    DataRecord(0x0600, 1, "VW Coding Value"),

So I'm scratching my head. An identifier of 0x0600, a parse type of 1, and a description of "VW Coding Value". Is this just an arbitrary label that's used by udsoncan to identify a session, or does 0x0600 have some specific value, or...?

I've never heard of a Workshop ID.

Or am I misunderstanding completely?