running userblock_tcpipconsole.c using RCM5600W delux dev kit

Hi,
I have the RCM5600W delux dev kit. When I tried to run the sample program, userblock_tcpipconsole.c

It compiles fine, but at run time it saids “Could not load the console configuration!”

This output is caused by console_init() != 0.

I am wondering what do I need to do to get the sample running. Thanks

nevermind, I figured it out. I have to make sure the device is connected to the SSID or else it will have this error. (Keep in mind that I haven’t plug in the serial communication board with the serial cable attached to my comp)

However, I have a new question:

  1. Is there documentation on using the zconsole library
  2. I understand that you can create custom console function functions but declaring the function, int myfunc(ConsoleState* state);
    Can someone give me some info on what does that state pointer point to? For example, it can go state->conio->puts. What other functions can it call?

Don’t know anything about zconsole, but it appears to be documented here:
http://www.rabbit.com/documentation/docs/manuals/TCPIP/UsersManualV2/index.html

The calls available through the state pointer come from the console I/O pointer within the state structure. The console I/O pointer (conio) is a structure of type ConsoleIO. It points to an entry in the console_io array that you must declare in your program. There are several predefined definitions for populating the console_io array. See the snippet from zconsole.lib below:

// ConsoleIO structure
typedef struct {
	long param;
	int (*open)();
	void (*close)();
	int (*tick)();
	int (*puts)();
	int (*rdUsed)();
	int (*wrUsed)();
	int (*wrFree)();
	int (*read)();
	int (*write)();
} ConsoleIO;

  ...      (lines left out here for brevity)

// pre-defined console_io structs
#define CONSOLE_IO_SERA(param)	{ param, serAopen, conio_serA_close, NULL, conio_serA_puts, serArdUsed, serAwrUsed, serAwrFree, serAread, serAwrite }
#define CONSOLE_IO_SERB(param)	{ param, serBopen, conio_serB_close, NULL, conio_serB_puts, serBrdUsed, serBwrUsed, serBwrFree, serBread, serBwrite }
#define CONSOLE_IO_SERC(param)	{ param, serCopen, conio_serC_close, NULL, conio_serC_puts, serCrdUsed, serCwrUsed, serCwrFree, serCread, serCwrite }
#define CONSOLE_IO_SERD(param)	{ param, serDopen, conio_serD_close, NULL, conio_serD_puts, serDrdUsed, serDwrUsed, serDwrFree, serDread, serDwrite }
#define CONSOLE_IO_SERE(param)	{ param, serEopen, conio_serE_close, NULL, conio_serE_puts, serErdUsed, serEwrUsed, serEwrFree, serEread, serEwrite }
#define CONSOLE_IO_SERF(param)	{ param, serFopen, conio_serF_close, NULL, conio_serF_puts, serFrdUsed, serFwrUsed, serFwrFree, serFread, serFwrite }
#define CONSOLE_IO_TELNET(port)	{ port, conio_telnet_open, conio_telnet_close, conio_telnet_tick, conio_telnet_puts, conio_telnet_rdUsed, conio_telnet_wrUsed, conio_telnet_wrFree, conio_telnet_read, conio_telnet_write }
#define CONSOLE_IO_SP(channel)	{ (long)channel, conio_sp_open, conio_sp_close, conio_sp_tick, conio_sp_puts, conio_sp_rdUsed, conio_sp_wrUsed, conio_sp_wrFree, conio_sp_read, conio_sp_write }

This allows 9 functions to be called for each defined Console I/O type in the console_io array. If you look at any sample using Zconsole, you will find a declaration of the console_io array. This sets up which functions are to be called from the 9 function pointers available under the state->conio pointer based on connection type.

If I want to add the gets() function to the ConsoleIO, how can I do that?
Do I have to recompile the zconsole.lib. How can we recompile the codes from the lib directory.

Thanks

Why do you want to do that? The entire point of the conio structure is to create a unified structure to talk to different port types for the underlying Zconsole functions. Since Zconsole is designed to talk to the outside world through several different communications ports, the conio options are serial ports A-F, a telnet session, or the Slave port to another CPU. The gets() function works with the stdio stream which is normally tied to the stdio window when debugging. Are you trying to get Zconsole to work with the stdio window during debug?

The functions in the conio structure all have to do with communicating through a certain type of port. This makes a convenient way to specify which ports should have access to the console system. It is not a method to expand the console into new functionality, only a port definition method.

Thanks for your prompt reply.

I would like the user to be able to do the following:

The user can type “set network” and it will bring up a prompt for the user to enter SSID, IP, network mask, WPA/WEP setting, password, etc.

Of course I can do it the normal way ie,
set ip 192.168.0.2
set mask 255.255.255.0
set ssid Rabbit
etc.

The reason for that is, eventually I need the user to open a web browser and control port A (which is used to control a relay for turning on/off light switches for home automation). Later I will also use the other I/O ports to communicate with an InfraRed chip to behave like a universial remote.

But before that, i will need the user to be able to set up the network configuration (SSID, ip, security, etc). I find the zconsole to be a good method since I can use both the console cable or telnet to do it (I can also excute other commands via the console, like turn on/off port A).

Of course I also need to implent the configuration of network settings for the device webpage, but that’s a later task.

Ideally, I hope to just read a config file from a usb flash drive. So the user can just create a txt file and input all the configuration there and the Rabbit device will read from it. But it seems I will need additional hardware and SPI code to suppor that FTDI usb chip

Hi eigh1234! I need the same you talk about. How did you resolve? Thank you!