Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
ryanrs
Jul 12, 2011

You will still be using busybox utils like cat and grep unless you also install coreutils and maybe some other packages. But a cursory test shows the busybox symlink commands work just fine from bash.

Adbot
ADBOT LOVES YOU

Beeftweeter
Jun 28, 2005

OFFICIAL #1 GNOME FAN

ryanrs posted:

You will still be using busybox utils like cat and grep unless you also install coreutils and maybe some other packages. But a cursory test shows the busybox symlink commands work just fine from bash.

yeah, they usually do

i still wonder if there's any benefit to using "[" vs. "[[" if you're only using busybox though. seems to me since they're both technically builtins there'd be no performance advantage to using either over the other, but since double brackets also have extended functionality idk why you'd ever use singles, other than maybe compatibility reasons?

:shrug:

Beeftweeter
Jun 28, 2005

OFFICIAL #1 GNOME FAN
speaking of busybox, does anyone use toybox?

it's what google uses in android instead of busybox, because they know the busybox people are serious about the GPL lol

i'd guess a lot of it is just BSD/AOSP-licensed busybox equivalents, but maybe it does some things better by dint of being newer? idk. the only exposure i have to it is using it in pretty drat old versions of android (7-10), and once you root those they usually install busybox for you lol. even termux comes with busybox iirc

e: hmm latest release is from 2023, although it seems to be kinda actively developed

Beeftweeter fucked around with this message at 22:50 on May 2, 2024

FlapYoJacks
Feb 12, 2009
How are temperatures cooler in Linux for my laptop than Windows? God drat Windows sucks lmfao.

FlapYoJacks fucked around with this message at 22:56 on May 2, 2024

ryanrs
Jul 12, 2011

Maybe poorly tuned Linux thermal management is running the fans faster than it should?

shackleford
Sep 4, 2006

50 background svchost.exe threads each using 0.05% CPU keeping your CPU package running in a higher C-state all the time

Perplx
Jun 26, 2004


Best viewed on Orgasma Plasma
Lipstick Apathy
windows is checking for start menu mods every 10ms

FlapYoJacks
Feb 12, 2009

Perplx posted:

windows is checking for start menu mods every 10ms

App those ads being served real-time in the start menu.

Baxate
Feb 1, 2011

forever pinging Microsoft servers awaiting the exact instant to nag you about yet another copilot product

Tankakern
Jul 25, 2007

Dell Laptop Platform Profile Patches Being Worked On For Linux

Poopernickel
Oct 28, 2005

electricity bad
Fun Shoe

Beeftweeter posted:

speaking of busybox, does anyone use toybox?

it's what google uses in android instead of busybox, because they know the busybox people are serious about the GPL lol

i'd guess a lot of it is just BSD/AOSP-licensed busybox equivalents, but maybe it does some things better by dint of being newer? idk. the only exposure i have to it is using it in pretty drat old versions of android (7-10), and once you root those they usually install busybox for you lol. even termux comes with busybox iirc

e: hmm latest release is from 2023, although it seems to be kinda actively developed

I use Busybox still, and don't have any plans to change in my designs. Busybox is GPL2, so it's not really a big deal to include in a product IMO. I have to make sources available for it (along with any modifications that I made to Busybox) on request, but that's not really a big deal. I don't have to give my entire product source-code, or my signing-keys, or anything like that.

It's been a while since I've checked, but I think that Busybox still has a lot more applets than Toybox. And a more active development community.

Beeftweeter
Jun 28, 2005

OFFICIAL #1 GNOME FAN

Poopernickel posted:

I use Busybox still, and don't have any plans to change in my designs. Busybox is GPL2, so it's not really a big deal to include in a product IMO. I have to make sources available for it (along with any modifications that I made to Busybox) on request, but that's not really a big deal. I don't have to give my entire product source-code, or my signing-keys, or anything like that.

It's been a while since I've checked, but I think that Busybox still has a lot more applets than Toybox. And a more active development community.

i spent an hour or two trying to get toybox to compile with WASI (using a-shell on my ipad, you can compile and execute WASM) and couldn't lol. but i was able to get a few of the applets to compile with the ios sdk, using llc to compile to bytecode and then lli to interpret

anyway yeah there definitely aren't as many features or applets, or features within applets. even printf is barebones compared to busybox

but i wasn't able to get it all to compile, and since i had to do it manually per applet i just didn't do more than 2 lol. it does seem like some of them are actually more fully featured than their busybox counterparts, but only a few, mostly ones that you'd expect android oems might want (dd, tar, etc.). since you do embedded work it might be worth a look-see

e: just to clarify, as you might've inferred you can compile each applet as a standalone application

Beeftweeter fucked around with this message at 02:35 on May 4, 2024

Clark Nova
Jul 18, 2004

FlapYoJacks posted:

How are temperatures cooler in Linux for my laptop than Windows? God drat Windows sucks lmfao.

my experience is that the CPU will run a lot less with linux (for instance, just think about running apt upgrade vs. whatever the hell makes windows update take 45 minutes on an nvme drive) but battery life is still somehow worse :shrug:

Beeftweeter
Jun 28, 2005

OFFICIAL #1 GNOME FAN
oh toybox has a status page (updated april 8), maddeningly though if you click on any of the commands it just links you to a sometimes nonexistent man page

though i guess if the goal is to make mostly identical implementations then that's kinda cool

the roadmap and faq are kinda interesting too

Sapozhnik
Jan 2, 2005

Nap Ghost
ostree is the gold standard for os upgrades and it is bizarre that none of the other desktop oses have anything that comes close. mobile things have a/b partitions which work similarly and are technically more secure in some rather insane threat scenarios i guess.

but yeah if silverblue wants to update itself it builds a deduplicated second /usr in the background from the bits it downloads and then it prompts you to reboot into it at time convenient for you. if the reboot fails then the kernel and /usr are rolled back. and each new build of silverblue is built from scratch on fedora's build servers so you don't have several years of god-knows-what crap being dragged around.

Nitrousoxide
May 30, 2011

do not buy a oneplus phone



Yeah there's really only three downsides to OSTree.
1: Non-RPMs are difficult to install, forcing you to build an rpm to overlay. This can be an issue with kernel mods or such.
2: The default overlay command doesn't let you run a newly installed application until you reboot into the new image. Though applying the --apply-live flag applies it to the current booted image now so you can avoid this
3: Updates take longer to prepare than a traditional package manager. That said, the updates area all prepared while the system is booted in the background and when you reboot it's just as fast as if no update was needed since you just booting into a different, complete, image. So you actually have more system uptime when doing updates.

ryanrs
Jul 12, 2011

Mystery Linux Puzzle

Calling all bluetooth protocol nerds: I've captured some hex!

I'm trying to get bluetooth working on my wifi router. It has a TI CC2540T on a TTL serial port, not USB. It uses serial, similar to board-mounted GPS modules. I do not think it has RTS and CTS hooked up (traces might exist on the pcb, but the SoC pins aren't configured for it right now).

When I connect to /dev/ttyMSM1 at 115200, I get periodic packets of garbage, but I think it's a binary protocol, not e.g. wrong baud rate.


I converted one of these bursts (not the one pictured above) into hex, and it looks like two packets:
code:
55 bytes = 0x37
ff 34 f5 00    06 35 31 32
13 15 34 0c    04 c8 0f 00
00 03 01 03    04 01 00 1a
01 00 19 01    00 06 01 0e
27 04 00 00    ff ff 18 0b
00 00 00 00    00 00 00 00
00 00 00 3b    01 00 04 

52 bytes = 0x34
ff 32 f9 00    06 35 31 32
13 15 34 01    02 00 00 02
02 00 00 0f    10 41 52 55
4e f9 9b 4a    3b 86 d0 94
70 70 69 3a    78 21 0a 00
00 00 00 c4    06 00 00 00
00 2a 01 c8
This pair of packets were sent together as a burst. Notice that the 2nd byte is close to the packet length.

So I think this is a hci_uart protocol, used to send bluetooth packets over 8-bit serial. I think I need to call btattach with the right protocol, but I haven't gotten it to work. Or maybe I need to call hciattach, again with some protocol arg?


Anyone know what hci protocol this is? It doesn't seem to match H4.


code:
root@OpenWrt:~# uname -a
Linux OpenWrt 6.6.29 #0 SMP Fri May  3 16:45:46 2024 armv7l GNU/Linux

root@OpenWrt:~# dmesg | grep -Fi blue
[   33.334366] Bluetooth: Core ver 2.22
[   33.334564] NET: Registered PF_BLUETOOTH protocol family
[   33.365751] Bluetooth: HCI device and connection manager initialized
[   33.429317] Bluetooth: HCI socket layer initialized
[   33.505322] Bluetooth: L2CAP socket layer initialized
[   33.560579] Bluetooth: SCO socket layer initialized
[   33.625386] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[   33.679309] Bluetooth: BNEP filters: protocol multicast
[   33.745960] Bluetooth: BNEP socket layer initialized
[   34.334237] Bluetooth: HCI UART driver ver 2.3
[   34.334301] Bluetooth: HCI UART protocol H4 registered
[   34.373928] Bluetooth: HCI UART protocol BCSP registered
[   34.452948] Bluetooth: HIDP (Human Interface Emulation) ver 1.2
[   34.501075] Bluetooth: HIDP socket layer initialized
[   34.635421] Bluetooth: RFCOMM TTY layer initialized
[   34.635510] Bluetooth: RFCOMM socket layer initialized
[   34.686511] Bluetooth: RFCOMM ver 1.11
OpenWrt only has drivers installed for H4 and BCSP, so it's not quite as simple as trying each protocol until something works.

It's also possible this is the CC2540T bootloader asking me to upload the firmware image. But I don't think so, since the CC2540T contains plenty of flash.


My goal is to figure out the necessary magic, then document it on the OpenWrt wiki. If I can get it working, I might try tethering my router to my phone for lols.


e: for some reason, the module is able to terminate my terminal programs (screen, picocom) just with this binary data. I wrote a plain C program to read the serial tty and print better error info.

code:
04 ff 34 [ f5 00 06 35 31 32 13 15 34 0c 04 28 00 00 00 03 01 03 04 01 00 1a 01 00 19 01 00 06 01 0e 27 04 00 00 ff ff 18 0b 00 00 00 00 00 00 00 00 00 00 00 3b 01 00 ]
04 ff 32 [ f9 00 06 35 31 32 13 15 34 01 02 00 00 02 02 00 00 0f 10 41 52 55 4e f9 9b 4a 3b 86 d0 94 70 70 69 3a 78 21 0a 00 00 00 00 c4 06 00 00 00 00 2a 01 c8 ]


04 ff 34 [ f5 00 06 35 31 32 13 15 34 0c 04 3c 00 00 00 03 01 03 04 01 00 1a 01 00 19 01 00 06 01 0e 27 04 00 00 ff ff 18 0b 00 00 00 00 00 00 00 00 00 00 00 3b 01 00 ]
04 ff 33 [ f9 00 06 35 31 32 13 15 34 07 01 10 08 01 01 1e 01 01 0d 01 02 09 01 01 0a 01 02 0b 01 2a 20 03 01 00 02 1f 0a 03 87 12 87 12 03 98 ad 98 ad 1d 02 54 24 ]


   ff 34 [ f5 00 06 35 31 32 13 15 34 0c 04 50 00 00 00 03 01 03 04 01 00 1a 01 00 19 01 00 06 01 0e 27 04 00 00 ff ff 18 0b 00 00 00 00 00 00 00 00 00 00 00 3b 01 00 ]
04 ff 32 [ f9 00 06 35 31 32 13 15 34 01 02 00 00 02 02 00 00 0f 10 41 52 55 4e f9 9b 4a 3b 86 d0 94 70 70 69 3a 78 21 0a 00 00 00 00 c4 06 00 00 00 00 2a 01 c8 ]
read() ret=0

read() ret=0

read() ret=0

read() ret=0

read() ret=0
So there is a 0x04 prefix that was not getting printed by the terminal programs (even in full hex mode). And it was even missing from one packet printed by my program, which is weird.

Now the byte count field at offset 3 exactly matches the length of the following packet body, enclosed with [ ].

Finally, after that last packet, the device causes read() to immediately return 0 several times in a row. If I restart my program, it can open and block on the read() once again. How would a 3 wire serial port cause that? Break signal maybe?

I think I need to set the serial tty line discipline to n_hci (15). But I have not messed with line disciplines before and the linux docs contain some dire warnings:

quote:

Do not re-use ldisc numbers as they are part of the userspace ABI and writing over an existing ldisc will cause demons to eat your computer. You must not re-register over the top of the line discipline even with the same data or your computer again will be eaten by demons. In order to remove a line discipline call tty_unregister_ldisc().
:ohdear:

e3: maybe the format matches TI's vendor HCI. The opcodes in the hexdump don't seem to decode, tho.

ryanrs fucked around with this message at 17:34 on May 4, 2024

BlankSystemDaemon
Mar 13, 2009



Sapozhnik posted:

ostree is the gold standard for os upgrades and it is bizarre that none of the other desktop oses have anything that comes close. mobile things have a/b partitions which work similarly and are technically more secure in some rather insane threat scenarios i guess.

but yeah if silverblue wants to update itself it builds a deduplicated second /usr in the background from the bits it downloads and then it prompts you to reboot into it at time convenient for you. if the reboot fails then the kernel and /usr are rolled back. and each new build of silverblue is built from scratch on fedora's build servers so you don't have several years of god-knows-what crap being dragged around.
i’m pretty sure its beat by installing updates into a boot environment and then rebooting, with the ability to powercycle the machine to get back into the exact environment you were in
all without any kind of self-repair nonsense that’s likely to break when there’s inevitable edgecases

sb hermit
Dec 13, 2016





ryanrs posted:


Finally, after that last packet, the device causes read() to immediately return 0 several times in a row. If I restart my program, it can open and block on the read() once again. How would a 3 wire serial port cause that? Break signal maybe?


I don’t own an oscilloscope so I can’t look at the raw voltages and how they change in a given time frame, and I don’t really know how ttl serial works at the physical level, but it kind of sounds like the host processor is receiving a lot of hangup signals which is causing read() to return zero.

https://learn.sparkfun.com/tutorials/serial-communication/all

According to this, an idle line is one where the voltage is high. My guess is that this is the best way to indicate carrier and that there’s someone on the other end. That end will bring the voltage low in order to indicate data.

I haven’t found any documentation to support this, but I suspect that letting the rx stay low for awhile will indicate a loss of carrier to the host processor. In which case, the driver would probably want to cut any blocking call with a short read because there’s no one on the other end of the line.

BattleMaster
Aug 14, 2000

sb hermit posted:

Anyways, taking all of this seriously...

I don't have a lot of GPIO experience beyond just raspberry pi. But I'm looking at the stuff in the kernel documentation:

https://www.kernel.org/doc/Documentation/gpio/gpio.txt

Assuming that the gpio hardware:
  • is capable of using interrupts during state changes to eliminate polling
  • has well-written drivers that take interrupts into account

You can just use select() or poll() on the gpio as it is exposed on the filesystem in a userspace application. This leads to the simplest code that uses blocking so 0% CPU is used while waiting. And since the code is all in userspace, it's easier to debug and manage. You don't really want to put "business logic" in a kernel driver that turns downstream PoE on and off unless it's the only way to address your use case because it can lead to dependency issues and the kernel doesn't really expose the right interfaces within the kernel itself to address that use case. Personally, I would be constantly worried about whether I hold the correct mutexes or if other context information is relevant.

I have a Mesa 6i25 card and it's such a weird thing. It has no drivers, the closest thing to drivers it comes with is a text file with all the memory offsets for the memory locations you read/write to interact with it. So okay, you assign it the UIO driver which lets you mmap it, and then you read some registers and do some raw pointer math to calculate all the necessary offsets. This part was easy to me at least, and it's lightning fast since it makes no system calls (read()/write()/ioctl()) to interact with which otherwise have an overhead associated with it. You dereference the pointers as if they were any other memory and the memory controller turns those into PCI commands, great.

However, it doesn't have any interrupt on change capabilities. It's designed for controlling mills and other similar pieces of manufacturing gear that don't really have a use for things other than like stepper controllers and quadrature counters and such. But, the UIO device file which you can mmap to expose device memory actually lets you poll() or blocking read it to wait for an interrupt if the device can generate those.

Thing is, the source code for the firmware is available. While it's a PCIe device, it's actually an FPGA implementing original PCI connected to a PCI to PCIe ASIC. I also have reason to believe that the interrupt line is hooked up because the vague documentation seems to suggest one of the peripherals that I don't understand makes use of it.

The firmware is also arranged as a core module and one module per peripheral type, and you can compile firmware with the number of each module you want to use. So theoretically it should be fairly easy to implement an interrupt-on-change module that toggles the interrupt line and gives you a register that tells you which pins changed since you last read it.

But I don't know any HDL and especially not the one it uses, so guess I'd better learn at some point

BattleMaster fucked around with this message at 18:00 on May 4, 2024

ryanrs
Jul 12, 2011

Found another clue:

I timed the packet bursts, and they are almost 60 secs apart.

I have GPIO access to the bluetooth module's reset line, and tried asserting it for a while. The packets stopped coming.

When I de-asserted the bluetooth reset, it takes exactly 60 secs before I see a packet.

code:
Release RESET line.

[ 60 sec ]

04 ff 34 f5 00 06 35 31 32 13 15 34 0c 04 3c 00
00 00 03 01 03 04 01 00 1a 01 00 19 01 00 06 01
0e 27 04 00 00 ff ff 18 0b 00 00 00 00 00 00 00
00 00 00 00 3b 01 00

04 ff 33 f9 00 06 35 31 32 13 15 34 07 01 10 08
01 01 1e 01 01 0d 01 02 09 01 01 0a 01 02 0b 01
2a 20 03 01 00 02 1f 0a 03 87 12 87 12 03 98 ad
98 ad 1d 02 54 24

[ 20 sec ]

04 ff 34 f5 00 06 35 31 32 13 15 34 0c 04 50 00
00 00 03 01 03 04 01 00 1a 01 00 19 01 00 06 01
0e 27 04 00 00 ff ff 18 0b 00 00 00 00 00 00 00
00 00 00 00 3b 01 00

04 ff 32 f9 00 06 35 31 32 13 15 34 01 02 00 00
02 02 00 00 0f 10 41 52 55 4e f9 9b 4a 3b 86 d0
94 70 70 69 3a 78 21 0a 00 00 00 00 c4 06 00 00
00 00 2a 01 c8

[ 20 sec ]

04 ff 34 f5 00 06 35 31 32 13 15 34 0c 04 64 00
00 00 03 01 03 04 01 00 1a 01 00 19 01 00 06 01
0e 27 04 00 00 ff ff 18 0b 00 00 00 00 00 00 00
00 00 00 00 3b 01 00

04 ff 33 f9 00 06 35 31 32 13 15 34 07 01 10 08
01 01 1e 01 01 0d 01 02 09 01 01 0a 01 02 0b 01
2a 20 03 01 00 02 1f 0a 03 87 12 87 12 03 98 ad
98 ad 1d 02 54 24

[ 20 sec ]

04 ff 34 f5 00 06 35 31 32 13 15 34 0c 04 78 00
00 00 03 01 03 04 01 00 1a 01 00 19 01 00 06 01
0e 27 04 00 00 ff ff 18 0b 00 00 00 00 00 00 00
00 00 00 00 3b 01 00

04 ff 32 f9 00 06 35 31 32 13 15 34 01 02 00 00
02 02 00 00 0f 10 41 52 55 4e f9 9b 4a 3b 86 d0
94 70 70 69 3a 78 21 0a 00 00 00 00 c4 06 00 00
00 00 2a 01 c8

[ 20 sec ]

ff 34 f5 00 06 35 31 32 13 15 34 0c 04 8c 00 00
00 03 01 03 04 01 00 1a 01 00 19 01 00 06 01 0e
27 04 00 00 ff ff 18 0b 00 00 00 00 00 00
00 00 00 00 00 3b 01 00

04 ff 33 f9 00 06 35 31 32 13 15 34 07 01 10 08
01 01 1e 01 01 0d 01 02 09 01 01 0a 01 02 0b 01
2a 20 03 01 00 02 1f 0a 03 87 12 87 12 03 98 ad
98 ad 1d 02 54 24
read() ret=0 zeroooo

read() ret=0 zeroooo

read() ret=0 zeroooo

read() ret=0 zeroooo

read() ret=0 zeroooo
Looks like it's going through a boot + timeouts loop.


sb hermit posted:

According to this, an idle line is one where the voltage is high. My guess is that this is the best way to indicate carrier and that there’s someone on the other end. That end will bring the voltage low in order to indicate data.

I haven’t found any documentation to support this, but I suspect that letting the rx stay low for awhile will indicate a loss of carrier to the host processor. In which case, the driver would probably want to cut any blocking call with a short read because there’s no one on the other end of the line.

Yes, this seems likely. After the last timeout, it might hold the line low for a bit, then reset itself.

ryanrs fucked around with this message at 18:00 on May 4, 2024

BattleMaster
Aug 14, 2000

Crap I can't believe I did a quote instead of edit

Beeftweeter
Jun 28, 2005

OFFICIAL #1 GNOME FAN
60 seconds apart? it sounds like it didn't get anywhere near close to initializing enough to do this but, uh, they're not bluetooth beacons, are they?

ryanrs
Jul 12, 2011

Could be? It's the built-in bluetooth module in an Aruba 'enterprise' wifi access point. So whatever their enterprise customers use bluetooth for, I guess.

Would they start beaconing poo poo before even establishing host comms?

e: HPE Aruba AP-303H Hospitality AP. For when your enterprise is a hotel, I guess.

BattleMaster
Aug 14, 2000

That honestly sounds like a use case where you'd want to specifically make use of Bluetooth beacons, not letting people actually connect to it that way

Beeftweeter
Jun 28, 2005

OFFICIAL #1 GNOME FAN

ryanrs posted:

Could be? It's the built-in bluetooth module in an Aruba 'enterprise' wifi access point. So whatever their enterprise customers use bluetooth for, I guess.

Would they start beaconing poo poo before even establishing host comms?

e: HPE Aruba AP-303H Hospitality AP. For when your enterprise is a hotel, I guess.

i honestly don't know. it's possible i guess. if the chip isn't even communicating with the system then i'd think it's really unlikely, but it could be a host advertisement beacon

ryanrs
Jul 12, 2011

BTW, these bytes aren't being sent over the air (I hope). They're coming in on the Host Controller Interface (HCI). I think it's trying to handshake, then getting mad about being snubbed.

sb hermit
Dec 13, 2016





BattleMaster posted:


The firmware is also arranged as a core module and one module per peripheral type, and you can compile firmware with the number of each module you want to use. So theoretically it should be fairly easy to implement an interrupt-on-change module that toggles the interrupt line and gives you a register that tells you which pins changed since you last read it.

But I don't know any HDL and especially not the one it uses, so guess I'd better learn at some point

you’re a braver person than I am

I draw the line at fpgas… maybe I’ll pick it up someday but so many of those tools are proprietary and the hardware is so hard to source

although I think I have a cyclone v somewhere

Beeftweeter
Jun 28, 2005

OFFICIAL #1 GNOME FAN

ryanrs posted:

BTW, these bytes aren't being sent over the air (I hope). They're coming in on the Host Controller Interface (HCI). I think it's trying to handshake, then getting mad about being snubbed.

yeah, i thought maybe it could just be regurgitating what it's trying to send over the air, but idk probably not. just throwing out suggestions

i agree it does seem more like it's trying to boot, not receiving whatever it's looking for and looping because of that, though. but i'm pretty sure you and sb have more knowledge about debugging this kind of thing than i do lol

sb hermit
Dec 13, 2016





tbh, I think it would be cool to control an access point over bluetooth if you somehow can’t get to it over ethernet and need to reset it or something and you’d otherwise have to bust out a ladder to get to it

Beeftweeter
Jun 28, 2005

OFFICIAL #1 GNOME FAN

sb hermit posted:

tbh, I think it would be cool to control an access point over bluetooth if you somehow can’t get to it over ethernet and need to reset it or something and you’d otherwise have to bust out a ladder to get to it

you probably can? there's BNEP (ethernet emulation), if it had a bridge to the rest of the interfaces you should be able to, in theory anyway

but tbh i've never even thought about adding bluetooth to a router. i suppose it'd be pretty easy with one of those little usb bt adapters though, maybe i can give it a try when i get openwrt going

sb hermit
Dec 13, 2016





It would be a funny but completely logical move for a hardware engineer to just hook up the lines and not have anyone listen to them because a PM decided that there was no budget or interest in writing the glue to allow the software to actually talk to the bluetooth chip

and if the bluetooth chip emits the beacon as needed, mission accomplished

sb hermit
Dec 13, 2016





Beeftweeter posted:

you probably can? there's BNEP (ethernet emulation), if it had a bridge to the rest of the interfaces you should be able to, in theory anyway

but tbh i've never even thought about adding bluetooth to a router. i suppose it'd be pretty easy with one of those little usb bt adapters though, maybe i can give it a try when i get openwrt going

That’s true. I was more going for a binary protocol over a serial interface or something.

Actually bridging the bluetooth ethernet, wifi ethernet, and physical ethernet traffic sounds like quite a flex but maybe a mite bit unnecessary.

On the other hand, your comment made me think a little more about it. Exposing the bluetooth as an ethernet device would probably be the best idea to configure it because you could just use a web browser. A much more modern 2024 solution than asking the user to install custom software to talk serial over bluetooth.

ryanrs
Jul 12, 2011

sb hermit posted:

tbh, I think it would be cool to control an access point over bluetooth if you somehow can’t get to it over ethernet and need to reset it or something and you’d otherwise have to bust out a ladder to get to it

Automatic internet failover by tethering to the nearest employee smartphone and making it the default route for the entire department.

ryanrs
Jul 12, 2011

sb hermit posted:

It would be a funny but completely logical move for a hardware engineer to just hook up the lines and not have anyone listen to them because a PM decided that there was no budget or interest in writing the glue to allow the software to actually talk to the bluetooth chip

and if the bluetooth chip emits the beacon as needed, mission accomplished

It's actually a big time feature mentioned in all their marketing material.

Enterprise wifi 'owns' the backhaul in corporate deployments, in the sense that there is big invested capital to get power+data in the form of ethernet to APs all over the building. So the enterprise gear has adopted stuff like bluetooth, zigbee, and other low power protocols. And it does honestly make sense to have wifi APs be the backhaul for these low power protocols, rather than building out a parallel system on 2.4 GHz low bandwidth mesh. And as a bonus, if you can take a bunch of open standards and combine them in such a way that your proprietary management software is required to run it all, that's a win, too.

ryanrs
Jul 12, 2011

I just thought of an amazing hack to reprogram the CC2540 in-system.

Disable both the console uart and the bluetooth uart on the SoC. Use the SoC gpio pin routing to make a crossover cable in the SoC fabric to connect the bluetooth serial port pins to the console uart pins. Then I should be able to talk directly to the CC2540 via the router's normal console port.

e: Hmm, not sure that will work. I wish I had the SoC programming manual.

I know on Nordic microcontrollers you can do weird stuff like attach 1 input pin to multiple peripherals. I guess a less-weird solution would be to echo characters between the uarts.

But I'm not sure it even needs to have firmware loaded. None of the NOR partitions looked like CC2540 code. The ELF binaries I found were all for ARM (the CC2540 has a 8051).

ryanrs fucked around with this message at 01:57 on May 5, 2024

ryanrs
Jul 12, 2011

TI BLE Vendor Specific HCI Reference Guide

It's a Bluetooth HCI command being tunneled inside a vendor-specific HCI event packet. It definitely looks like Texas Instrument's HCI extensions, which makes sense.

Now I just need to find where the hci_ll kernel driver is hiding (hopefully somewhere in kernel_menuconfig).

e: part of my confusion was that somewhere along the way, linux stopped calling TI's extensions "texas" and renamed it to "ll", which is really hard to search for.

ryanrs fucked around with this message at 04:01 on May 5, 2024

Adbot
ADBOT LOVES YOU

shackleford
Sep 4, 2006

lol i'm setting up a new AT&T internet connection with a linux router behind their gateway device

i was trying to figure out why my router lost its DHCPv6 address and prefix delegations overnight

my first thought was i had run into another IPv6/DHCPv6 bug in their lovely gateway firmware

nope, turns out i forgot to allow the inbound DHCPv6 packets

code:
ip6 saddr fe80::/10 ip6 daddr fe80::/10 udp sport 547 udp dport 546 accept

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply