Uzenet

Topics regarding the Uzebox hardware/AVCore/BaseBoard (i.e: PCB, resistors, connectors, part list, schematics, hardware issues, etc.) should go here.
User avatar
D3thAdd3r
Posts: 3222
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: Uzenet

Post by D3thAdd3r »

Just put the boards together tonight, very easy, nice and compact. Everyone with an Uzebox console should get one of these. For a few $ in parts you will be able to do internet stuff with other Uzeboxers, just drink a couple less beers on friday and you already paid for it :)

The way I did mine for now is a lot taller and wont fit in the case. I put an 8pin socket so I can get the 8266 in/out as I expect custom firmware is going to be required. I want to start on that again, I got seriously sidetracked for a while.
User avatar
kivan117
Posts: 73
Joined: Sat Mar 14, 2015 5:43 am

Re: Uzenet

Post by kivan117 »

Just got mine in the mail the other day! Very exciting. Would love to get to work on my first Uzenet program this weekend if possible. Few questions so far:

First, concerning the emulator, what's the present state of Uzenet emulation? What is and is not possible without using the actual hardware?

Second, concerning the Uzenet pcb hardware, how close are we to having a hex to program in the user's wifi SSID, password etc?

Finally, for a first "real" Uzenet program, I was thinking about trying to polish up the Uzenet chat server demo. Use the new 80 column mode 9, player 1 input would be tied to a variant of the on screen keyboard and player 2 be the new hardware keyboard. Left shoulder could switch between upper and lower case, select shows/hides the keyboard, and start sends the message for player 1. If hardware keyboard input is detected on player 2, maybe just act like the first player pressed select and auto-hide the on screen keyboard. However, this would be less an accomplishment of my own so much as me mashing together a few of the things you guys already did :lol: That said, I was curious about some of the things server side for the chat program. Does it have a generic "hi, I'm logged on now" and "i'm leaving" sort of message it expects, or is it literally just a take in strings and print them sort of thing right now? I'm curious because a simple command to list people actively logged on (e.g. /list) might be nice to add in to the above program as well. If it doesn't exist yet, I was thinking we could just add a simple "logged on" type message and a simple "logged off" message for communication between the server and the Uzeboxes (Uzeboxi, Uzeboxen, flock of Uze?) with the server tracking the people currently online. Since the server may not always (or even often) receive a "logging off" message, perhaps it periodically just probes the users on the list to test if a connection is still live and if it doesn't get a reply, it uses that as a backup means of removing inactive users from the list. Similarly, the client would periodically do a connection test to make sure it was in fact talking to the server still.

Sorry about the rant. The possibility of online is just very exciting and we're so close right now that it's hard to wait until I can start working on it :D
User avatar
D3thAdd3r
Posts: 3222
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: Uzenet

Post by D3thAdd3r »

kivan117 wrote:First, concerning the emulator, what's the present state of Uzenet emulation? What is and is not possible without using the actual hardware?
Currently I am dropping the ball on this, doing side projects instead(robotic money pit), but I'm looking to at least get a game using online high score boards soon. In some ways it's pretty close to usable...except the speed was terrible if you check out the forum topic about it here. I had made some decent progress to the point it would connect to the chatroom and function as expected, and connect to nethack.alt.org(but don't have a proper TELNET client yet), pull a web page, etc, but extremely slowly due to calling the ESP8266 core every time a serial byte COULD be there. If you think about it, to have accurate emulation you would have to do that. In reality, we are not talking about microsecond timing for the command/responses and it's affected by internet latency. I do suspect the emulator will have better latency characteristics than the real thing when it's done.

I have a test build running on a separate thread now and the speed is good, it is not reliable at all now because I need to change the way the UART works to avoid race conditions. The 8266's on board co-processor, I can't see us emulating it accurately with any speed, while running the rest of Uzem. Luckily the 8266 is pretty easy to abstract into a "black box", since the only real communication is Rx/Tx, and the onboard processor could only communicate using those lines they way it's currently wired up(and that co-processor just processes the AT stuff in normal firmware). Now the reason I had halted for a while is a revelation that the normal run of the mill firmware might not be adequate for our purposes. The firmware I propose, but have done nothing on yet, would use an entirely different(basically shortest possible 1 byte command/responses) command set to increase UART performance, and perhaps add some helper functionality so not every Uzebox games has to have code for things like ping, get server list, etc. So whatever I just said there, perhaps we should just go full steam ahead with the stock firmware idea in Uzem, come back and change it when it proves to be not good enough. Having people interested leans me back towards getting something at least working in the interim, because people networking these things will be very awesome.
kivan117 wrote:Second, concerning the Uzenet pcb hardware, how close are we to having a hex to program in the user's wifi SSID, password etc?
Only thing that sucks is parsing the big string list of AP names, otherwise pretty easy. This is pretty important to have, no reason it couldn't be done in short order if some one had the time. I should probably do that instead of screwing around on other stuff, if I recall the last build of the emulator I released even supports the AT+CWLAP command with a list of made up APs and signal strengths specifically for developing said program.
kivan117 wrote:Finally, for a first "real" Uzenet program, I was thinking about trying to polish up the Uzenet chat server demo.
Yes that would be very nice to have pulling it all together, basically it would the first real revolution to happen. I say go for it, it's not a trivial task and would be impressive, especially since it is all bleeding edge stuff(I don't even know how to use the keyboard in my own game code yet, and I am probably half the user base for it currently :lol: ).

I attached the source code for the chat server so you can know the protocol. There should already be most of the stuff you want implemented, ideas on any of that just add it and make it official. I threw a bunch of small network test type programs like this together as fast as I could, so they are terribly written and there could be some bugs or such also. There is a protocol in place to make sure random port scanners can't get on without passing the challenge. Connect, send "UZECHAT", it will say "ENTER USER NAME", then send the name you want. Send text and everyone will see it, use "+whisper some_guy some text"to send "some text" to some_guy only, there is more you will see in the code.
Attachments
uzenetchatsrc.zip
(6.19 KiB) Downloaded 117 times
CunningFellow
Posts: 1445
Joined: Mon Feb 11, 2013 8:08 am
Location: Brisbane, Australia

Re: Uzenet

Post by CunningFellow »

How much space saving would be needed in the bootloader to have WiFi SSID things set up there and saved in EEPROM so each app didnt need to worry about it?
User avatar
D3thAdd3r
Posts: 3222
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: Uzenet

Post by D3thAdd3r »

From what I understand from uzeboxcore.c the kernel only uses 1 block, 0x5A55, there are 6 bytes set aside for a MAC address and 9 bytes set aside for reserved, now seems as good a time as any to use those reserved bytes. I don't know, could it be useful for the Uzebox to know it's particular 8266 MAC? With stock firmware it isn't easy to get, you would need some other device like your router to tell you what it is. I can't figure out a need for it. I am not sure what is best for that, since the 8266 only needs to be setup once, after that it remembers the SSID/pass even after power is removed. The program should not have to set any of that up, it could do AT+CWJAP and if it succeeds it worked, otherwise the user didn't use the setup utility so give an error message. It would require multiple blocks since wifi credentials could be pretty long, I haven't seen it forget the credentials, but that doesn't mean it never could?

I was starting to think it would be very nice for network play if games did not have to have menus to setup names and stuff. It would be pretty nice if you could set your name in a setup utility, save to eeprom reserved bytes, and then when you play games you always have your name, if you get a high score it can just fill it out for you(so non-network games could do that too). For chatroom or anything similar it's annoying to have to type your name out each time you join, for some high performance games they might not be able to spare the space for name entry tiles/etc.
User avatar
kivan117
Posts: 73
Joined: Sat Mar 14, 2015 5:43 am

Re: Uzenet

Post by kivan117 »

Adding an option in our basic WiFi setup program to set your preferred user name would definitely simplify things for most people. If we're already making a wifi setup hex, adding a separate menu option for preferred nickname would make it more of a Uzenet one-stop setup tool. I'd bet the majority of Uzeboxes are single user machines and a way to "set and forget" your preferred user name would definitely help reduce complexity and simplify storing and sending high scores locally and online for both the programmer and eventual user. Plus it doesn't prevent anyone from still using their own custom name entry method in their game if they prefer.
User avatar
uze6666
Site Admin
Posts: 4801
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Uzenet

Post by uze6666 »

kivan117 wrote:
Second, concerning the Uzenet pcb hardware, how close are we to having a hex to program in the user's wifi SSID, password etc?

Only thing that sucks is parsing the big string list of AP names, otherwise pretty easy. This is pretty important to have, no reason it couldn't be done in short order if some one had the time. I should probably do that instead of screwing around on other stuff, if I recall the last build of the emulator I released even supports the AT+CWLAP command with a list of made up APs and signal strengths specifically for developing said program.
I got sidetracked too with other stuff. The way I think will be best is to have a dedicated wifi setup uzebox program (a bit like emuze for the eeprom). In there, you will be able to setup the ssid, password, nickname, access key, whatever. Since the module remember the last access point, games would just try to connect and if receiving an error ask the user to use the setup program. I'd like that the thing is a bit secure so each uzenet member has a nickname and password/key. The key could be provided by the forums (or on a Uzebox.net page someday), I can easily add a new field to the private profile of members.

For a first version of the setup tool, I'll make it simple and just load the ssid and password data from a sd card file (i.e UZENET.KEY). More to come.
User avatar
kivan117
Posts: 73
Joined: Sat Mar 14, 2015 5:43 am

Re: Uzenet

Post by kivan117 »

Got the UzenetDemo compiled, modified slightly to be 80 columns and played with it a bit. Had some troubles initially getting it to talk to my ESP8266 though. Apparently mine prefers 57600 baud. Threw me for a loop since I kind of just anticipated throwing the right AT commands at it and having it work. Once I changed that portion of the source though it ran smoothly. So, if you check the chat server's logs you should see where I've been hopping on and spamming the same 4 messages, hopping off, then repeating. Next stop: incorporating the on screen keyboard idea so I can have some real messages, not just predefined ones.

For the other 8266's in use, are they all set to 57600 baud by default? Does it vary per chip/per firmware? Is it something that you can set via the Uzenet setup program? Just curious I guess. In addition to the basic wifi ssid and password, mine needed the mode of operation changed and I had to make sure I had the right baud, so that could be some more background magic for the Uzenet setup program to configure.

I've noticed it doesn't take much to have problems setting up the initial server connection. It frequently times out or has some other hang up getting initially connected to my router, or from there to the server. Once I've connected that first time though, I can more or less disconnect and reconnect quickly at will so long as I don't power cycle it. Granted when I say problems I just mean it doesn't work first try. 2 or 3 attempts almost always does the trick. Have you all been seeing similar performance?

Very happy with it so far though. Not too long ago I was soldering some bits together atop a cardboard box in my dining room (much to my wife's dismay) and now I have an 8 bit console that's internet capable and runs games and programs I've put together. Pretty awesome feeling of accomplishment already and I'm not even the one doing the heavy lifting :) Just wanted to throw out a congrats on the work so far guys. Can't wait to see where this Uzenet business leads.
User avatar
uze6666
Site Admin
Posts: 4801
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Uzenet

Post by uze6666 »

I programmed your to 57600, the "official" baud rate so far. I had made tests and it seems the most stable were we don't lose characters. This rate also allows for a reasonably small rx buffer.

So I understand you were able to connect to you router? You added a At+CWJAP to set the ssid and password I guess? Great then, less rush to make a config program. :P
I've noticed it doesn't take much to have problems setting up the initial server connection. It frequently times out or has some other hang up getting initially connected to my router, or from there to the server. Once I've connected that first time though, I can more or less disconnect and reconnect quickly at will so long as I don't power cycle it. Granted when I say problems I just mean it doesn't work first try. 2 or 3 attempts almost always does the trick. Have you all been seeing similar performance?
Not for me at least, it reconnects easily 99% of the time. Perhaps it has something to do with your router of the security you're using? If your router offers it, try creating another virtual network with a different ssid and using WEP. That's what I did for the uzenet access.
User avatar
kivan117
Posts: 73
Joined: Sat Mar 14, 2015 5:43 am

Re: Uzenet

Post by kivan117 »

So I understand you were able to connect to you router? You added a At+CWJAP to set the ssid and password I guess?
Yup. Once I had the demo working I just added that step into the initialization for one run, then took it back out. That step can actually be left in of course it's just unnecessary. I also told it to act as a client only, not as both a client and a Wi-Fi access point.... That command is a bit different. If it's already in the mode that you try to set (say, maybe because you're lazy, ran zero checks, and just left the set command :oops: ) it spits an error code. So I just removed both at once since they were no longer needed.
Not for me at least, it reconnects easily 99% of the time. Perhaps it has something to do with your router of the security you're using? If your router offers it, try creating another virtual network with a different ssid and using WEP. That's what I did for the uzenet access.
Maybe it's just trying to prove me to be a liar or something because now its connection to my router is flawless. Guess I can't complain. Takes it a few seconds but works first time now! The connection to the server seems to be working pretty consistently also. Could be due to the insane amount of 2.4Ghz networks where I live. Who knows. If the Uzebox is booting from a powered off state it takes the ESP8266 a it longer to connect compared to resetting the ROM, which is expected behavior really.

I definitely understand the appeal of having our own custom firmware in the future now that I've been messing with this some. The stock one is quite verbose and at times a bit odd in its messages. Parsing all the fluff out of the messages without creating bugs will take some time. But that'll be a nicety for after I have this a little more complete.
Post Reply