# A brick wall that i've smacked into with hex codes

**URL:** <https://community.thunkable.com/t/a-brick-wall-that-ive-smacked-into-with-hex-codes/1068428>\
**Category:** Questions about Thunkable X\
**Tags:** help, advanced\
**Created:** [January 25, 2021, 9:16pm UTC](https://community.thunkable.com/t/a-brick-wall-that-ive-smacked-into-with-hex-codes/1068428 "2021-01-25T21:16:41Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![bluerfox15uht9](https://avatars.discourse-cdn.com/v4/letter/b/3be4f8/32.png) [@bluerfox15uht9](https://community.thunkable.com/u/bluerfox15uht9)\
**Post date:** [January 25, 2021, 9:16pm UTC](https://community.thunkable.com/t/a-brick-wall-that-ive-smacked-into-with-hex-codes/1068428/1 "2021-01-25T21:16:42Z")

</div>

I’m currently attempting to make an app for my mechanic shop. I’ve mentioned this before. I bought a Bluetooth obd2 plug that was capable of transmitting live data. the issue is, apparently the obd system has an immensely complicated hex system that ive been trying to wrap my head around for about a week now. . .

I see all of these apps using a (_not_ web) api to parse this data. I’ve spent almost a year on this platform trying to get this app working only for the thing, that i assumed was going to be the simplest, and is the most crucial to be something that I don’t think, from what i know, thunkable is capable of helping with.

all I’m attempting to do is get some data from the sensors every so often based on time or the cars mileage, assuming i can parse it.

does anyone know of a function that i could possibly use to overcome this?

the wiki page showing the, rather confounding, hexadecimal stuff.

> **[OBD-II PIDs | Query](https://en.wikipedia.org/wiki/OBD-II_PIDs#Query)**
>
> The functional PID query is sent to the vehicle on the CAN bus at ID 7DFh, using 8 data bytes. The bytes are:

The obd2 program “api” that i would like to use if possible to do so

> **[eltonvs/java-obd-api](https://github.com/eltonvs/java-obd-api)**
>
> :oncoming\_automobile: An OBD-II API written in Java

---

<div class="post-metadata">

**Author:** ![bluerfox15uht9](https://avatars.discourse-cdn.com/v4/letter/b/3be4f8/32.png) [@bluerfox15uht9](https://community.thunkable.com/u/bluerfox15uht9)\
**Post date:** [January 25, 2021, 9:20pm UTC](https://community.thunkable.com/t/a-brick-wall-that-ive-smacked-into-with-hex-codes/1068428/2 "2021-01-25T21:20:33Z")

</div>

i forgot to mention that this is a Bluetooth device, but i think the input and output responses are the major part of this and less the Bluetooth part

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [January 25, 2021, 10:42pm UTC](https://community.thunkable.com/t/a-brick-wall-that-ive-smacked-into-with-hex-codes/1068428/3 "2021-01-25T22:42:56Z")

</div>

I honestly love these kinds of challenges. But I know how they can drive you mad!

I had some success parsing hexadecimal data [here](http://community.thunkable.com/t/bluetooth-low-energy-transmits-but-does-not-receive/646954/31). Maybe this has some similarities? I’ll have to sit down with this when I have some more time.

---

<div class="post-metadata">

**Author:** ![bluerfox15uht9](https://avatars.discourse-cdn.com/v4/letter/b/3be4f8/32.png) [@bluerfox15uht9](https://community.thunkable.com/u/bluerfox15uht9)\
**Post date:** [January 25, 2021, 11:09pm UTC](https://community.thunkable.com/t/a-brick-wall-that-ive-smacked-into-with-hex-codes/1068428/4 "2021-01-25T23:09:21Z")

</div>

this is the most sense something on this has made, but i was looking for someway to translate hex to  
the actual values. i.e. _hex code_ to actual value in rpm, it’d spit out 4000 in the example, but the simple math i can do on my own. lol, creating something as complex as a hex dictionary, not so much lol

---

<div class="post-metadata">

**Author:** ![bluerfox15uht9](https://avatars.discourse-cdn.com/v4/letter/b/3be4f8/32.png) [@bluerfox15uht9](https://community.thunkable.com/u/bluerfox15uht9)\
**Post date:** [January 25, 2021, 11:13pm UTC](https://community.thunkable.com/t/a-brick-wall-that-ive-smacked-into-with-hex-codes/1068428/5 "2021-01-25T23:13:09Z")

</div>

however, it doesn’t seem like you got to making anything functional… 🤔

the elm device only outputs numbers, so, that actually limits this quite a bit i might be able to work with that!  
but i think we might need to get a petition going to add codes to the translation function, that’d be an incredibly amazing addition, don’t you think?

---

<div class="post-metadata">

**Author:** ![bluerfox15uht9](https://avatars.discourse-cdn.com/v4/letter/b/3be4f8/32.png) [@bluerfox15uht9](https://community.thunkable.com/u/bluerfox15uht9)\
**Post date:** [January 25, 2021, 11:43pm UTC](https://community.thunkable.com/t/a-brick-wall-that-ive-smacked-into-with-hex-codes/1068428/6 "2021-01-25T23:43:30Z")

</div>

I see this table, an i wonder if it would be possible for me to rig a real time database to do it…

[![](https://cdn.shopify.com/s/files/1/1014/5789/files/Standard-ASCII-Table_large.jpg?10669400161723642407) ](https://cdn.shopify.com/s/files/1/1014/5789/files/Standard-ASCII-Table_large.jpg?10669400161723642407)

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [January 26, 2021, 12:03am UTC](https://community.thunkable.com/t/a-brick-wall-that-ive-smacked-into-with-hex-codes/1068428/7 "2021-01-26T00:03:26Z")

</div>

Can you tell me what a possible hex code would be and what a possible numeric value would be? I don’t expect you to translate them because that’s obviously what you need help with but… it would really help me understand this to know something like:

“The device might output something like 1B91842FED7 and I need to know what the decimal value is between 99999 and 999999 or I need to know which four two-digit codes are represented by it.”

In other words, what is an initial sensor value you expect to get from the device and what is a sample expected final value you hope to see to understand that data from a mechanic’s perspective?

**Edit:** is [this](https://www.csselectronics.com/screen/page/obd-ii-online-message-converter/language/en) the sort of conversion you need to be a part of your app? And if so, then [this documentation](https://www.csselectronics.com/screen/page/obd-ii-pid-examples) might prove useful to me and others trying to help you solve this challenge.

Also, does the table you posted right above this show the actual values you need or is it just an example of a table that would translate values? I’m trying to hone in on _actual_ sample values that you could see.

And I have no understanding of obd2 data (I had to Google the acronym) but it seems to me that you need an API that uses REST calls and JSON formatting. I couldn’t make heads or tails of the API github link you posted but I’m curious if this might do the trick: [REST API for Oracle IoT Fleet Monitoring Cloud Service - Retrieve vehicle on board diagnostics 2 (OBD2) parameters](https://docs.oracle.com/en/cloud/saas/iot-fleet-cloud/rest-api/op-v2-vehicles-vehicleid-parameters-devices-get.html)

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [January 26, 2021, 12:08am UTC](https://community.thunkable.com/t/a-brick-wall-that-ive-smacked-into-with-hex-codes/1068428/8 "2021-01-26T00:08:30Z")

</div>

> [@bluerfox15uht9](#):
>
> however, it doesn’t seem like you got to making anything functional… 🤔

Ah, but I did! Well, I believe I did. @pittsgal never quite confirmed my theories but I was pretty confident of them. 😏

---

<div class="post-metadata">

**Author:** ![bluerfox15uht9](https://avatars.discourse-cdn.com/v4/letter/b/3be4f8/32.png) [@bluerfox15uht9](https://community.thunkable.com/u/bluerfox15uht9)\
**Post date:** [January 26, 2021, 12:52am UTC](https://community.thunkable.com/t/a-brick-wall-that-ive-smacked-into-with-hex-codes/1068428/9 "2021-01-26T00:52:58Z")

</div>

sorry, this is the right link, this one made the most sense.

from what i understand, it’ll only ever return numbers for the most part, unless its an error code.

> **[Reading Real-Time Data | OBD Solutions](https://www.obdsol.com/knowledgebase/obd-software-development/reading-real-time-data/)**
>
> In this tutorial, you will learn how to connect to OBD-II and read RPM, speed, engine load, and coolant temperature. To follow along, you will need an OBD interface, a computer, and access to an OBD-II compliant vehicle. The OBD interface (“tester”)...

---

<div class="post-metadata">

**Author:** ![bluerfox15uht9](https://avatars.discourse-cdn.com/v4/letter/b/3be4f8/32.png) [@bluerfox15uht9](https://community.thunkable.com/u/bluerfox15uht9)\
**Post date:** [January 26, 2021, 1:11am UTC](https://community.thunkable.com/t/a-brick-wall-that-ive-smacked-into-with-hex-codes/1068428/11 "2021-01-26T01:11:36Z")

</div>

you have to se the mode, the example in that link is “auto” which is fine, because all I’m going to do is set it to do something like this:

connect to car obd2 bluetooth thing  
get the mileage, check if the car has driven, lets say, 20 miles since the last time it checked the milage  
if so  
grab a few data points  
coolant temp, tire pressure, and a few others.

issue is, i dont know how to get this part  
hex. . . | . . actual ascii value  
0x0FA0 = 4000

after i get the 4000, there’s a little calculation, but it can totally handle that, its no big deal.  
the main issue is the conversion FROM the hexadecimal to the ascii

the idea is to have more frames of diagnostic data to work with, and to have a way to actively tell the customer that they might need this or that based on legit stuff

---

<div class="post-metadata">

**Author:** ![bluerfox15uht9](https://avatars.discourse-cdn.com/v4/letter/b/3be4f8/32.png) [@bluerfox15uht9](https://community.thunkable.com/u/bluerfox15uht9)\
**Post date:** [January 26, 2021, 1:33am UTC](https://community.thunkable.com/t/a-brick-wall-that-ive-smacked-into-with-hex-codes/1068428/12 "2021-01-26T01:33:58Z")

</div>

i also just realized that its not converting from hex to ascii… its converting from hexadecimal to decimal

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [January 26, 2021, 1:59am UTC](https://community.thunkable.com/t/a-brick-wall-that-ive-smacked-into-with-hex-codes/1068428/13 "2021-01-26T01:59:45Z")

</div>

Right but you’re not getting 0x0FA0 from a physical device/sensor, are you? You’re getting a value like 41 0C 0F A0, right, according to the updated “Reading Real-Time Data” link you posted?

Just trying to understand the starting and ending points. Because if you have a device that gives you 0x0FA0, that’s going to be a different set of steps in Thunkable compared to the steps you’d need if you’re given 41 0C 0F A0. By the way, the 0x0FA0 is just the last four digits of 41 0C 0F A0. If you join them together and remove the space, you get 0FA0. And if you run 0FA0 through a hex to decimal converter online, you get 4000.

I think you’re going to want an API that will convert hex to decimal. It’s probably not _that hard_ to convert hex to decimal manually in Thunkable but it would be extra work.

---

<div class="post-metadata">

**Author:** ![bluerfox15uht9](https://avatars.discourse-cdn.com/v4/letter/b/3be4f8/32.png) [@bluerfox15uht9](https://community.thunkable.com/u/bluerfox15uht9)\
**Post date:** [January 26, 2021, 2:17am UTC](https://community.thunkable.com/t/a-brick-wall-that-ive-smacked-into-with-hex-codes/1068428/14 "2021-01-26T02:17:05Z")

</div>

It’s going to be an obd2 bluetooth device

So I have to send a request

And it responds in hex

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [January 26, 2021, 2:19am UTC](https://community.thunkable.com/t/a-brick-wall-that-ive-smacked-into-with-hex-codes/1068428/15 "2021-01-26T02:19:44Z")

</div>

Yes but… lol… what does the hex look like?

If I was holding the bluetooth device and sent it a request, what would I see on the screen?

Can you post a photo of such a screen?

---

<div class="post-metadata">

**Author:** ![bluerfox15uht9](https://avatars.discourse-cdn.com/v4/letter/b/3be4f8/32.png) [@bluerfox15uht9](https://community.thunkable.com/u/bluerfox15uht9)\
**Post date:** [January 26, 2021, 2:21am UTC](https://community.thunkable.com/t/a-brick-wall-that-ive-smacked-into-with-hex-codes/1068428/16 "2021-01-26T02:21:49Z")

</div>

And no it’ll be simpler now that I get it

“Get substring”  
Make a function block that decodes them, bla bla bla.

My main issue was the hex… It was spitting out emojis and stuff 🙄 damn… It was a waste of time…

---

<div class="post-metadata">

**Author:** ![bluerfox15uht9](https://avatars.discourse-cdn.com/v4/letter/b/3be4f8/32.png) [@bluerfox15uht9](https://community.thunkable.com/u/bluerfox15uht9)\
**Post date:** [January 26, 2021, 2:22am UTC](https://community.thunkable.com/t/a-brick-wall-that-ive-smacked-into-with-hex-codes/1068428/17 "2021-01-26T02:22:49Z")

</div>

It’s like this

The first 2 are the I’d of the sensor

Xx and the rest are a number from 0 to 9999

---

<div class="post-metadata">

**Author:** ![bluerfox15uht9](https://avatars.discourse-cdn.com/v4/letter/b/3be4f8/32.png) [@bluerfox15uht9](https://community.thunkable.com/u/bluerfox15uht9)\
**Post date:** [January 26, 2021, 2:23am UTC](https://community.thunkable.com/t/a-brick-wall-that-ive-smacked-into-with-hex-codes/1068428/18 "2021-01-26T02:23:47Z")

</div>

I haven’t gotten it working yet, admittedly. But I’m trying to get a grip on the hex before I do something wrong.

This description makes it perfectly clear

> **[Reading Real-Time Data | OBD Solutions](https://www.obdsol.com/knowledgebase/obd-software-development/reading-real-time-data/)**
>
> In this tutorial, you will learn how to connect to OBD-II and read RPM, speed, engine load, and coolant temperature. To follow along, you will need an OBD interface, a computer, and access to an OBD-II compliant vehicle. The OBD interface (“tester”)...

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [January 26, 2021, 2:26am UTC](https://community.thunkable.com/t/a-brick-wall-that-ive-smacked-into-with-hex-codes/1068428/19 "2021-01-26T02:26:37Z")

</div>

Okay, I’ve read that and I understand what it says but I think we’re having a problem communicating (text-based discussion is always a little tricky) because I’ve asked about four different ways what you actually see… a real example… and I still don’t know.

I know if I could see the physical device screen after you sent a request, I could help you solve this. None of this sounds difficult to me. A little time-consuming but not beyond what can be done in Thunkable.

I’m hoping someone else can pick up where I left off… I feel like we’re close to getting this figured out!

---

<div class="post-metadata">

**Author:** ![bluerfox15uht9](https://avatars.discourse-cdn.com/v4/letter/b/3be4f8/32.png) [@bluerfox15uht9](https://community.thunkable.com/u/bluerfox15uht9)\
**Post date:** [January 26, 2021, 2:31am UTC](https://community.thunkable.com/t/a-brick-wall-that-ive-smacked-into-with-hex-codes/1068428/20 "2021-01-26T02:31:02Z")

</div>

Yea, tomorrow morning I’m going to try to get some samples from my car, and then I’ll post some stuff.

Because I figured out what I was doing wrong… Now I just need to make a basic test-build for the bluetooth device.

I’ll show you when/if I get it going… I doubt it’ll be easy in any sense though, lol

---

<div class="post-metadata">

**Author:** ![bluerfox15uht9](https://avatars.discourse-cdn.com/v4/letter/b/3be4f8/32.png) [@bluerfox15uht9](https://community.thunkable.com/u/bluerfox15uht9)\
**Post date:** [January 26, 2021, 5:38pm UTC](https://community.thunkable.com/t/a-brick-wall-that-ive-smacked-into-with-hex-codes/1068428/21 "2021-01-26T17:38:16Z")

</div>

I HAVE RETURNED!

I made a base-16 to base-10 converter that took me a _bit_ too long to figure out! I messed up on the exponent thing at first, but now it works!  
[https://x.thunkable.com/copy/488447599dec20188fba59e1e7570261](https://x.thunkable.com/copy/488447599dec20188fba59e1e7570261)

[Next page](https://community.thunkable.com/t/a-brick-wall-that-ive-smacked-into-with-hex-codes/1068428.md?page=2)
