[info] rusEfi console

It's all about the code!
User avatar
russian
Site Admin
Posts: 9769
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Soldering skill: yes
Coding skill?: yes
Contact:

Re: dev console

Post by russian » Fri Feb 05, 2016 8:53 pm

Yes community edition
https://rusefi.com/s/howtocontribute
very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions
my skype is arro239

Ian
Posts: 13
Joined: Sat Jan 23, 2016 9:19 pm

Re: dev console

Post by Ian » Fri Feb 05, 2016 8:59 pm

I am currently doing an SVN update from "https://svn.code.sf.net/p/rusefi/code/trunk"

If it helps.. :)

User avatar
russian
Site Admin
Posts: 9769
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Soldering skill: yes
Coding skill?: yes
Contact:

Re: dev console

Post by russian » Fri Feb 05, 2016 9:12 pm

Btw console writes logs into 'out' folder. Can you please attach latest?
https://rusefi.com/s/howtocontribute
very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions
my skype is arro239

Ian
Posts: 13
Joined: Sat Jan 23, 2016 9:19 pm

Re: dev console

Post by Ian » Fri Feb 05, 2016 9:27 pm

logs.. // from Console..

last one first.. and seems to be the largest.. 78K
Attachments
MAIN_rfi_report_2016-02-05 20_32.csv
(77.85 KiB) Downloaded 414 times

Ian
Posts: 13
Joined: Sat Jan 23, 2016 9:19 pm

Re: dev console

Post by Ian » Fri Feb 05, 2016 9:30 pm

is 115200 the correct baud rate.. I noticed TS can change the baud rate ? just a thought..

User avatar
russian
Site Admin
Posts: 9769
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Soldering skill: yes
Coding skill?: yes
Contact:

Re: dev console

Post by russian » Fri Feb 05, 2016 9:38 pm

No baud rate on this VCP, any values works the same.
https://rusefi.com/s/howtocontribute
very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions
my skype is arro239

User avatar
russian
Site Admin
Posts: 9769
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Soldering skill: yes
Coding skill?: yes
Contact:

Re: dev console

Post by russian » Sun Feb 07, 2016 1:09 am

@ has realized that the issue is Windows 10.
https://sourceforge.net/p/rusefi/tickets/264/
https://rusefi.com/s/howtocontribute
very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions
my skype is arro239

Ian
Posts: 13
Joined: Sat Jan 23, 2016 9:19 pm

Re: dev console

Post by Ian » Sun Feb 07, 2016 3:28 pm

Loaded IntelliJ IDEA.. and ventured into JAVA for he first time.. having fun.. and learning.

what I have found is the Switch to Binary implementation "~ '\n" seems a little unreliable.

The snap shot below, seems to work on on my machine. but still not great..

what I have changed:
a. commented out close(); snip "if (isTimeout) { // close();" stops the exception error due the next port retry when the port is closed.
b. move the synchronized lock to further down, seems to allow the incomingData.waitForBytes(2, start, "switch to binary"); method access to the buffer, seems a resource lock issue. (possibly)
c. don't understand why it takes 15 attempts to switch to binary mode. changed it to three, seems to work on the second attempt.

still get lots of "Unexpected pending data: 1 byte(s)" ...
but a the gauges are now live..

Code: Select all

    public void switchToBinaryProtocol() {
        // we do not have reliable implementation yet :(
        for (int i = 0; i < 3; i++)
            doSwitchToBinary();
    }

    private void doSwitchToBinary() {


        while (true) {
            try {
                dropPending();

                stream.write((SWITCH_TO_BINARY_COMMAND + "\n").getBytes());

                // needs a delay here !! to allow 2 bytes to arrive
                Thread.sleep(100);

                long start = System.currentTimeMillis();

                    boolean isTimeout = incomingData.waitForBytes(2, start, "switch to binary");
                    if (isTimeout) {
//                        close();
                        System.out.println("Timeout waiting for switch response");
                        return;
                    }
                synchronized (ioLock)      //MOVED FROM ABOVE
                {
                    int response = incomingData.getShort();
                     if (response != swap16(SWITCH_TO_BINARY_RESPONSE)) {
                        logger.error(String.format("Unexpected response [%x], re-trying", response));
                        continue;
                    }
                    logger.info("Switched to binary protocol");
                }
            } catch (IOException e) {
                close();
                FileLog.MAIN.logLine("exception: " + e);
                return;
            } catch (InterruptedException e) {
                throw new IllegalStateException(e);
            }
            break;
        }
    }

User avatar
russian
Site Admin
Posts: 9769
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Soldering skill: yes
Coding skill?: yes
Contact:

Re: dev console

Post by russian » Sun Feb 07, 2016 4:03 pm

The whole switch to binary is in fact a mess, I wish I remembered why 15 times - but the painful part is that this ugly code always works on Windows 7. See also https://sourceforge.net/p/rusefi/tickets/262/

I've made some changes to the code last night - not sure if you've updated - and now it does connect sometimes, like 50% of the times - which is better then "never" before that - on Windows 10. I am not sure which change made the difference, nothing seems stable.
// needs a delay here !! to allow 2 bytes to arrive
Thread.sleep(100);
I believe that this is not needed since waitForBytes method does the waiting.

Also about moving the lock down - on the one hand again I am now not sure what role it serve (I am keeping promising myself writing more documentation) but I am not sure how moving it below would change anything - what other code do you think is keeping this lock?
https://rusefi.com/s/howtocontribute
very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions
my skype is arro239

Ian
Posts: 13
Joined: Sat Jan 23, 2016 9:19 pm

Re: dev console

Post by Ian » Sun Feb 07, 2016 4:44 pm

I am thinking the synchronized (ioLock) stop the incomingdata thread from inserting new data in the buffer.

you can easily see when the dropPending is removed, first byte arrive, then second time around the loop 3 bytes arrive.

I agree the extra sleep(100) should never get used.

I will checkout your changes and try your code..

(welcome to Window 10... a little slower..)

User avatar
rus084
contributor
contributor
Posts: 678
Joined: Sun Dec 01, 2013 1:40 pm
Location: Russia , Stavropol
Soldering skill: yes
Coding skill?: yes
Contact:

Re: dev console

Post by rus084 » Mon Feb 08, 2016 2:06 pm

console works on Android via Linux Deploy but need load UI before port is opened (cpu is slow) . in theory it can be connected via serial usb, but i haven't usb otg .
[video][/video]

консоль работает на смартфоне через Linux deploy . это chroot окружение линукса , запускаемое под андроидом (программы используют ядро и драйвера андроида) . графику вывожу с помощью X server напрямик в драйвер дисплея , так достигается максимальная скорость работы (графика андроида приостанавливается чтобы не было конфликтов ) .

консоль очень долго грузится поскольку одновременно грузится UI и обрабатываются данные с порта .
по идее оно должно работать и через usb , но я не могу проверить так как у меня нет usb otgв смартфоне

User avatar
russian
Site Admin
Posts: 9769
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Soldering skill: yes
Coding skill?: yes
Contact:

Re: dev console

Post by russian » Sun Feb 14, 2016 2:48 am

Windows 10 should kind of work now - https://sourceforge.net/p/rusefi/tickets/264/

I am not excited about the fix- I do not know the root cause of the issue, I've just hacked around it - but it seems to work.
https://rusefi.com/s/howtocontribute
very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions
my skype is arro239

jaw.asl
Posts: 1
Joined: Fri Feb 24, 2017 5:46 am

Re: rusEfi console

Post by jaw.asl » Fri Feb 24, 2017 5:54 am

hello I bought rusefi and trying to link it with computer via micro usb cable but i am not able to connect it via com port. i have installed the drivers for stm 32 but still no connectivity with dev console as well as tunerstudio. i have tried every possible way which is mentioned in the forums. kindly can you help me out in connecting my rusefi to computer so that i can interact with it.
regards
jaw.asl

User avatar
russian
Site Admin
Posts: 9769
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Soldering skill: yes
Coding skill?: yes
Contact:

Re: rusEfi console

Post by russian » Fri Feb 24, 2017 11:53 am

What OS are you using? Please post a screen shot of your device manager. You need st virtual com port driver.

What exactly did you buy? There should also be another mini usb on the board which should be another com port
https://rusefi.com/s/howtocontribute
very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions
my skype is arro239

Post Reply