temp reporting only reports once?

jdgordon

New member
hey,
My computer started overheating so ive finally started writign the fan controller for linux..
anywho... I send the command to report the 2 connected temps and it only reports back once?

so here is my horrible code..
Code:
outgoing_response.command = 1;
    outgoing_response.data_length = 0;
    send_packet();
    while (check_for_packet())
        ShowReceivedPacket();
    /* set up temp reporting */
    outgoing_response.command = 19;
    outgoing_response.data_length = 4;
    outgoing_response.data[0] == 0x03;
    outgoing_response.data[1] == 0x00;
    outgoing_response.data[2] == 0x00;
    outgoing_response.data[3] == 0x00;
    send_packet();
    while (check_for_packet())
        ;
    ShowReceivedPacket();
    while (1)
    {
        sleep(1);
        while (check_for_packet())
        {
            char buf[64];
            if (incoming_command.command == 0x82)
            {
                OnReceivedTempReport(&incoming_command,buf);
                printf("%s\n",buf);
            }
        }
    }
now, it should get the hardware info, setup reporting then spit out the report as they come in right?
ok, after a bit of investigating, if i ping the display in the while(1) loop then i will get a fan report (a single 1) and its always "1044.3750?C =1911.8750?F" (string got from the temp->string conversion code in the datasheet)..

am i doing something wrong? or is my hardware faulty or something?
cheers

edit: i just realised i was trying to get a report from my 635 which doesnt have the scab connected... i changed the port to my 631 which does have the scab and still the same.. so im guessing i must be doing something wrong.? (my 631 has a live display setup if that makes a difference)

edit2: im a dill... i was checking for 0x40|19 when i should have been checking for 0x82 which ive changed it to and now i get nothing :'(
________
BONDAGE PAIN
Looking for additional LCD resources? Check out our LCD blog for the latest developments in LCD technology.
 
Last edited:

CF Support

Administrator
Try this for your loop:

Code:
while (1)
{
    if(check_for_packet(&incoming_response))
    {
        char buf[64];
        if (incoming_command.command == 0x82)
        {
            OnReceivedTempReport(&incoming_command,buf);
            printf("%s\n",buf);
        }
    }
}
 

jdgordon

New member
hmm...
check_for_packet() is taken from the 631 linux test code and it takes no parameters...
I set it up to show the incoming button packets and that works.. so any other ideas?
________
SQUIRTING BLACK
 
Last edited:

jdgordon

New member
nope, still nothing.
Code:
while (1)
    {
        if (check_for_packet())
        {
            char buf[64];
            switch (incoming_command.command)
            {
                case 0x82: /* temp report */
                    OnReceivedTempReport(&incoming_command,buf);
                    printf("%s\n",buf);
                    break;
                case 0x80: /* key press */
                case 0x81: /* fan */
                default:
                    ShowReceivedPacket();
            }
        }
    }
button presses work fine, no fan reports (although none are connected) and no temp reports (4 probes are connected).
________
SHOWER TUBES
 
Last edited:

jdgordon

New member
Code:
if(Serial_Init(port,baud))
    {
        printf("Could not open port \"%s\" at \"%d\" baud.\n",port,baud);
        return(1);
    }
    outgoing_response.command = 1;
    outgoing_response.data_length = 0;
    send_packet();
    while (!check_for_packet())
        ;
    ShowReceivedPacket();
    /* set up temp reporting */
    outgoing_response.command = 19;
    outgoing_response.data_length = 4;
    outgoing_response.data[0] == 0xff;
    outgoing_response.data[1] == 0xff;
    outgoing_response.data[2] == 0xff;
    outgoing_response.data[3] == 0xff;
    send_packet();
    while (!check_for_packet())
        ;
    ShowReceivedPacket();
    /* and fan reporting */
    /* set up temp reporting */
    outgoing_response.command = 16;
    outgoing_response.data_length = 1;
    outgoing_response.data[0] == 0x0f;
    send_packet();
    while (!check_for_packet())
        ;
    ShowReceivedPacket();
    while (1)
    {
        if (check_for_packet())
        {
            char buf[64];
            switch (incoming_command.command)
            {
                case 0x82: /* temp report */
                    OnReceivedTempReport(&incoming_command,buf);
                    printf("%s\n",buf);
                    break;
                case 0x80: /* key press */
                case 0x81: /* fan */
                default:
                    ShowReceivedPacket();
            }
        }
     //   usleep(30000);
    }
________
STARCRAFT 2 REPLAY UPLOADER
 
Last edited:

CF Support

Administrator
Have you verified that the same setup will work with 633_Wintest? The code looks ok, but if it works for the fan and key presses, you might have a problem with your OnReceivedTempReport() function. Does it display the temperature reporting packet if this is commented out by defaulting to the ShowReceivedPacket() function?
 

jdgordon

New member
I commented out all the stuff under the 0x82 case so it falls through to ShowReceivedPacket(); and still nothing.

I have tried the same setup in windows (on another computer though) with 635_wintest and the temp probe reads fine.
________
CHRYSLER 300 LETTER SERIES HISTORY
 
Last edited:

CF Support

Administrator
Pardon the question, but have you power cycled the module since the sensors have been plugged in? It is possible that they haven't been enumerated.
 

jdgordon

New member
i plugged the 635 into the computer with both the scab and temp prob connected, but other than that, no i havnt. That should be fine tho no?

should i try using the re-enum command before i start?

edit: i thought there was a re-enum command, ill try rebooting i and see what happens
________
Vaporizer
 
Last edited:

jdgordon

New member
ok, this is wierd...
I do a soft reboot (command 5) and then ping then set up the temp reporting I get this..

C=65( 1 = Read Version),L=16,D="CFA635:h1.0,v1.0",CRC=0x804E447
C=211(Error: Set Temp. Rept.),L=0,D="",CRC=0x8047A14

(i disabled the fan reporting because that seems to work, it was sending lots of "C=129( 1 = Read Version),L=4,D="\003\002\000\000",CRC=0x8044B63" back. ?

edit: just tried this with the 631 and same thing happens :(
________
Threesome Mmw
 
Last edited:
Top