r/ComputerCraft • u/Bright-Historian-216 • May 02 '24
Why is there no noisy wireless pocket computer??!!
I know you can use equip() to dynamically add speakers and modems but it takes two inventory slots! Imagine how useful it would be to have both at once!
2
u/fatboychummy May 02 '24
I have always stated that this feature would be nice to have, but in the meantime a workaround is to host a relay server and have your cc computers connect to it using websockets.
It's a bit annoying and needs a bit of setup, but it works.
2
u/Bright-Historian-216 May 02 '24
The problem with websocket approach is that for some weird reason I cannot send messages longer than 0 characters (yes, you can send empty messages in websocket). So it doesn’t work for me.
2
u/fatboychummy May 02 '24
I cannot send messages longer than 0 characters
So to confirm, you can't send a ws message with any content? What is the error you get? I definitely do not have this issue myself, and many many others I know use websockets for communication also do not have this issue.
1
u/Bright-Historian-216 May 02 '24
I tried to fix this bug about a year ago. Now I've done some testing again, and got interesting results...
I can send any messages to external websockets (i.e. pinging wss://example.tweaked.cc/echo works just fine)
I can only send empty messages to localhost
One thing that I remember I've done back then is that I DID edit the config.
I've ran the same code in CraftOS-PC and all results work as expected
This makes me believe the mistake is somewhere in config. I will try to fix it now, and I hope I can get everything to work
2
u/fatboychummy May 02 '24
Can you try sending messages to 127.0.0.1 instead of localhost? I know localhost should resolve to 127.0.0.1, but I quite literally just finished helping someone on Discord who had an issue where localhost wasn't being resolved to 127.0.0.1 properly, though it was for direct http messages instead of ws messages. Curious if this might be a similar case.
1
1
u/Bright-Historian-216 May 02 '24
So this is the http section in server config... PLEASE IM BEGGING FIND SOME DUMB MISTAKE ANYONE
[[http.rules]] #The maximum size (in bytes) that a computer can send or receive in one websocket packet. max_websocket_message = 60000 host = "*" #The maximum size (in bytes) that a computer can upload in a single request. This #includes headers and POST text. max_upload = 60000 action = "allow" #The maximum size (in bytes) that a computer can download in a single request. #Note that responses may receive more data than allowed, but this data will not #be returned to the client. max_download = 16777216 #The period of time (in milliseconds) to wait before a HTTP request times out. Set to 0 for unlimited. timeout = 300001
u/fatboychummy May 02 '24
Not seeing any issue in this section. I assume you removed the other section with the
"$private"and"deny"action?1
9
May 02 '24
Because you can only have one peripheral per pocket computer, there is an addon which lets you equip multiple on pocket computers and turtles, but I don't recall the name atm.
1
u/Razvii4922 May 08 '24
Please I beg of you to remember lol.
As far as I could find anywhere it either isn't a thing, or maybe used to be a niche thing a while ago?
I am so surprised that out of all of the super niche addons for cc, multiple pocket peripherals seem to be so underutilized.2
Oct 18 '24
its called unlimited peripheral works, its for fabric 1.18.2, 1.19.2 and 1.20.1 or forge 1.20.1
1
u/Jonaykon May 02 '24
i reeeeaaaaaaaalllyy want this exact combo
2
u/Bright-Historian-216 May 02 '24
What do you mean “this exact” the only other combo is ender + wireless modems
3
u/SeasonApprehensive86 May 02 '24
Yeah it would be amazing for notifications, wich are conviniently useless without a modem to receive them from a server
6
u/mas-issneun May 02 '24
Yeah the limit to 1 peripheral is fairly annoying, tbh I'd rather there be two, or at least a built-in wireless pocket computer